org.codehaus.groovy.runtime.memoize
Class UnlimitedConcurrentCache

java.lang.Object
  extended by org.codehaus.groovy.runtime.memoize.UnlimitedConcurrentCache
All Implemented Interfaces:
MemoizeCache<Object,Object>

public final class UnlimitedConcurrentCache
extends Object
implements MemoizeCache<Object,Object>

A cache backed by a ConcurrentHashMap

Author:
Vaclav Pech

Constructor Summary
UnlimitedConcurrentCache()
           
 
Method Summary
 void cleanUpNullReferences()
          Replying on the ConcurrentHashMap thread-safe iteration implementation the method will remove all entries holding SoftReferences to gc-evicted objects.
 Object get(Object key)
           
 Object put(Object key, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnlimitedConcurrentCache

public UnlimitedConcurrentCache()
Method Detail

put

public Object put(Object key,
                  Object value)
Specified by:
put in interface MemoizeCache<Object,Object>

get

public Object get(Object key)
Specified by:
get in interface MemoizeCache<Object,Object>

cleanUpNullReferences

public void cleanUpNullReferences()
Replying on the ConcurrentHashMap thread-safe iteration implementation the method will remove all entries holding SoftReferences to gc-evicted objects.

Specified by:
cleanUpNullReferences in interface MemoizeCache<Object,Object>

Copyright © 2003-2012 The Codehaus. All rights reserved.