org.glassfish.grizzly
Class ThreadCache.ObjectCache

java.lang.Object
  extended by org.glassfish.grizzly.ThreadCache.ObjectCache
Enclosing class:
ThreadCache

public static final class ThreadCache.ObjectCache
extends Object


Constructor Summary
ThreadCache.ObjectCache()
           
 
Method Summary
<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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadCache.ObjectCache

public ThreadCache.ObjectCache()
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. Unlike take(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.

take

public <E> E take(ThreadCache.CachedTypeIndex<E> index)
Take the cached object with the given type index from cache. Unlike get(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 © 2012 Oracle Corporation. All Rights Reserved.