Package jadex.concurrent
Class Token
java.lang.Object
jadex.concurrent.Token
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
acquired
protected boolean acquiredTrue, 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.
-