Package org.glassfish.grizzly
Class ThreadCache.ObjectCache
- java.lang.Object
-
- org.glassfish.grizzly.ThreadCache.ObjectCache
-
- Enclosing class:
- ThreadCache
public static final class ThreadCache.ObjectCache extends Object
-
-
Constructor Summary
Constructors Constructor Description ObjectCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E> E
get(ThreadCache.CachedTypeIndex<E> index)
Get the cached object with the given type index from cache.boolean
put(ThreadCache.CachedTypeIndex index, Object o)
<E> E
take(ThreadCache.CachedTypeIndex<E> index)
Take the cached object with the given type index from cache.
-
-
-
Method Detail
-
put
public boolean put(ThreadCache.CachedTypeIndex index, Object o)
-
get
public <E> E get(ThreadCache.CachedTypeIndex<E> index)
Get the cached object with the given type index from cache. Unliketake(org.glassfish.grizzly.ThreadCache.CachedTypeIndex)
, the object won't be removed from cache.- Type Parameters:
E
- cached object type- Parameters:
index
- the cached object type index.- Returns:
- cached object.
-
take
public <E> E take(ThreadCache.CachedTypeIndex<E> index)
Take the cached object with the given type index from cache. Unlikeget(org.glassfish.grizzly.ThreadCache.CachedTypeIndex)
, the object will be removed from cache.- Type Parameters:
E
- cached object type- Parameters:
index
- the cached object type index.- Returns:
- cached object.
-
-