Class Cache.OriginThreadAwareFuture
- java.lang.Object
-
- org.glassfish.jersey.internal.util.collection.Cache.OriginThreadAwareFuture
-
- All Implemented Interfaces:
java.util.concurrent.Future<V>
private class Cache.OriginThreadAwareFuture extends java.lang.Object implements java.util.concurrent.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.
-
-
Constructor Summary
Constructors Constructor Description OriginThreadAwareFuture(K key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)booleanequals(java.lang.Object obj)Vget()Vget(long timeout, java.util.concurrent.TimeUnit unit)inthashCode()booleanisCancelled()booleanisDone()voidrun()
-
-
-
Field Detail
-
future
private final java.util.concurrent.FutureTask<V> future
-
threadId
private volatile long threadId
-
-
Constructor Detail
-
OriginThreadAwareFuture
OriginThreadAwareFuture(K key)
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancelin interfacejava.util.concurrent.Future<V>
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfacejava.util.concurrent.Future<V>
-
isDone
public boolean isDone()
- Specified by:
isDonein interfacejava.util.concurrent.Future<V>
-
get
public V get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
- Specified by:
getin interfacejava.util.concurrent.Future<V>- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionException
-
get
public V get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Specified by:
getin interfacejava.util.concurrent.Future<V>- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutException
-
run
public void run()
-
-