Class Cache.OriginThreadAwareFuture
java.lang.Object
org.glassfish.hk2.utilities.cache.Cache.OriginThreadAwareFuture
- All Implemented Interfaces:
Future<V>
Helper class, that remembers the future task origin thread, so that cycles could be detected.
If any thread starts computation for given key and the same thread requests the computed value
before the computation stops, a cycle is detected and registered cycle handler is called.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
threadId
private volatile long threadId -
future
-
-
Constructor Details
-
OriginThreadAwareFuture
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<V>
-
isDone
public boolean isDone() -
get
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
-
get
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
run
public void run()
-