java.lang.Object
org.glassfish.grizzly.ThreadCache.ObjectCache
- Enclosing class:
- ThreadCache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<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.
-
Constructor Details
-
ObjectCache
public ObjectCache()
-
-
Method Details
-
put
-
get
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
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.
-