java.lang.Object
org.glassfish.grizzly.ThreadCache
- Author:
- oleksiys
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classstatic final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E> EgetFromCache(Thread currentThread, ThreadCache.CachedTypeIndex<E> index) Get the cached object with the given type index from cache.static <E> EgetFromCache(ThreadCache.CachedTypeIndex<E> index) Get the cached object with the given type index from cache.static <E> ThreadCache.CachedTypeIndex<E>obtainIndex(Class<E> clazz, int size) static <E> ThreadCache.CachedTypeIndex<E>obtainIndex(String name, Class<E> clazz, int size) static <E> booleanputToCache(Thread currentThread, ThreadCache.CachedTypeIndex<E> index, E o) static <E> booleanputToCache(ThreadCache.CachedTypeIndex<E> index, E o) static <E> EtakeFromCache(Thread currentThread, ThreadCache.CachedTypeIndex<E> index) Take the cached object with the given type index from cache.static <E> EtakeFromCache(ThreadCache.CachedTypeIndex<E> index) Take the cached object with the given type index from cache.
-
Constructor Details
-
ThreadCache
public ThreadCache()
-
-
Method Details
-
obtainIndex
-
obtainIndex
-
putToCache
-
putToCache
public static <E> boolean putToCache(Thread currentThread, ThreadCache.CachedTypeIndex<E> index, E o) -
getFromCache
Get the cached object with the given type index from cache. UnliketakeFromCache(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.
-
getFromCache
Get the cached object with the given type index from cache. UnliketakeFromCache(org.glassfish.grizzly.ThreadCache.CachedTypeIndex), the object won't be removed from cache.- Type Parameters:
E- cached object type- Parameters:
currentThread- currentThreadindex- the cached object type index.- Returns:
- cached object.
-
takeFromCache
Take the cached object with the given type index from cache. UnlikegetFromCache(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
-
takeFromCache
Take the cached object with the given type index from cache. UnlikegetFromCache(org.glassfish.grizzly.ThreadCache.CachedTypeIndex), the object will be removed from cache.- Type Parameters:
E- cached object type- Parameters:
currentThread- currentThreadindex- the cached object type index- Returns:
- cached object
-