Class Token

java.lang.Object
jadex.concurrent.Token

public class Token extends Object
A token is initially available can be acquired once. The thread safe implementation allows multiple threads to try to acquire the token and guarantees that one and only one thread will get the token.
  • Field Details

    • acquired

      protected boolean acquired
      True, if the token is acquired.
  • Constructor Details

    • Token

      public Token()
  • Method Details

    • acquire

      public boolean acquire()
      Try to acquire the token.
      Returns:
      True, if the token was acquired by the caller.