Class LRUHybridCache.OriginThreadAwareFuture
java.lang.Object
org.glassfish.hk2.utilities.cache.LRUHybridCache.OriginThreadAwareFuture
- All Implemented Interfaces:
Future<HybridCacheEntry<V>>
- Enclosing class:
LRUHybridCache<K,
V>
private class LRUHybridCache.OriginThreadAwareFuture
extends Object
implements Future<HybridCacheEntry<V>>
Helper class, that remembers the future task origin thread, so that cycles could be detected.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FutureTask
<HybridCacheEntry<V>> private final K
private long
private long
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
key
-
future
-
threadId
private volatile long threadId -
lastHit
private volatile long lastHit
-
-
Constructor Details
-
OriginThreadAwareFuture
OriginThreadAwareFuture(LRUHybridCache<K, HybridCacheEntry<V>> cache, K key)
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) - Specified by:
cancel
in interfaceFuture<HybridCacheEntry<V>>
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<HybridCacheEntry<V>>
-
isDone
public boolean isDone()- Specified by:
isDone
in interfaceFuture<HybridCacheEntry<V>>
-
get
- Specified by:
get
in interfaceFuture<HybridCacheEntry<V>>
- Throws:
InterruptedException
ExecutionException
-
get
public HybridCacheEntry<V> get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
get
in interfaceFuture<HybridCacheEntry<V>>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
run
public void run()
-