org.glassfish.grizzly
Class ThreadCache
java.lang.Object
org.glassfish.grizzly.ThreadCache
public final class ThreadCache
- extends java.lang.Object
- Author:
- oleksiys
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadCache
public ThreadCache()
obtainIndex
public static <E> ThreadCache.CachedTypeIndex<E> obtainIndex(java.lang.Class<E> clazz,
int size)
obtainIndex
public static <E> ThreadCache.CachedTypeIndex<E> obtainIndex(java.lang.String name,
java.lang.Class<E> clazz,
int size)
putToCache
public static <E> boolean putToCache(ThreadCache.CachedTypeIndex<E> index,
E o)
getFromCache
public static <E> E getFromCache(ThreadCache.CachedTypeIndex<E> index)
- Get the cached object with the given type index from cache.
Unlike
takeFromCache(org.glassfish.grizzly.ThreadCache.CachedTypeIndex), the
object won't be removed from cache.
- Type Parameters:
E - - Parameters:
index - the cached object type index.
- Returns:
- cached object.
takeFromCache
public static <E> E takeFromCache(ThreadCache.CachedTypeIndex<E> index)
- Take the cached object with the given type index from cache.
Unlike
getFromCache(org.glassfish.grizzly.ThreadCache.CachedTypeIndex), the
object will be removed from cache.
- Type Parameters:
E - - Parameters:
index - the cached object type index.
- Returns:
- cached object.
Copyright © 2011 Oracle Corpration. All Rights Reserved.