protected boolean removeEldestEntry(Map.Entry eldest) { return size() > SimpleLRUCache.this.cacheSize; } };
public boolean containsKey(Object key) { synchronized(mutex) {return cache.containsKey(key);} }
/** * Returns a thread-safe cache backed by the specified cache. * In order to guarantee thread-safety, all access to the backed cache must * be accomplished through the returned cache. */ public static Cache synchronizedCache(Cache cache) { return cache.getSynchronizedCache(); }
public Object get(Object key) { synchronized(mutex) {return cache.get(key);} }
public void put(Object key, Object value) { synchronized(mutex) {cache.put(key, value);} }
/** * Called by {@link #synchronizedCache(Cache)}. This method * returns a {@link SynchronizedCache} instance that wraps * this instance by default and can be overridden to return * e. g. subclasses of {@link SynchronizedCache} or this * in case this cache is already synchronized. */ Cache getSynchronizedCache() { return new SynchronizedCache(this); }
public Object get(Object key) { synchronized(mutex) {return cache.get(key);} }
public boolean containsKey(Object key) { synchronized(mutex) {return cache.containsKey(key);} }
public void close() { synchronized(mutex) {cache.close();} }
Cache getSynchronizedCache() { return new SynchronizedSimpleMapCache(this); }
public Set keySet() { synchronized(mutex) {return cache.keySet();} }
public void put(Object key, Object value) { synchronized(mutex) {cache.put(key, value);} }
protected boolean removeEldestEntry(Map.Entry eldest) { return size() > SimpleLRUCache.this.cacheSize; } };
/** * Returns a thread-safe cache backed by the specified cache. * In order to guarantee thread-safety, all access to the backed cache must * be accomplished through the returned cache. */ public static Cache synchronizedCache(Cache cache) { return cache.getSynchronizedCache(); }
/** * Called by {@link #synchronizedCache(Cache)}. This method * returns a {@link SynchronizedCache} instance that wraps * this instance by default and can be overridden to return * e. g. subclasses of {@link SynchronizedCache} or this * in case this cache is already synchronized. */ Cache getSynchronizedCache() { return new SynchronizedCache(this); }
public Object get(Object key) { synchronized(mutex) {return cache.get(key);} }
public boolean containsKey(Object key) { synchronized(mutex) {return cache.containsKey(key);} }
public void close() { synchronized(mutex) {cache.close();} }
Cache getSynchronizedCache() { return new SynchronizedSimpleMapCache(this); }
public Set keySet() { synchronized(mutex) {return cache.keySet();} }