com.atlassian.cache.ehcache
Class LoadingCache<K,V>

java.lang.Object
  extended by net.sf.ehcache.constructs.EhcacheDecoratorAdapter
      extended by net.sf.ehcache.constructs.blocking.BlockingCache
          extended by com.atlassian.cache.ehcache.LoadingCache<K,V>
Type Parameters:
K - the cache's key type
V - the cache's value type
All Implemented Interfaces:
Cloneable, net.sf.ehcache.Ehcache, net.sf.ehcache.terracotta.InternalEhcache

public class LoadingCache<K,V>
extends net.sf.ehcache.constructs.blocking.BlockingCache

A rewrite of SelfPopulatingCache with stronger concurrency guarantees. Unfortunately, since the locks are local and cache replication happens at the Ehcache layer, bypassing these locks, this is still not good enough for clusters. It is, however, an improvement.


Field Summary
 
Fields inherited from class net.sf.ehcache.constructs.blocking.BlockingCache
timeoutMillis
 
Fields inherited from class net.sf.ehcache.constructs.EhcacheDecoratorAdapter
underlyingCache
 
Constructor Summary
LoadingCache(net.sf.ehcache.Ehcache cache, CacheLoader<K,V> loader)
           
 
Method Summary
 net.sf.ehcache.Element get(Object key)
           
 boolean remove(Object key)
           
 boolean remove(Object key, boolean doNotNotifyCacheReplicators)
           
 boolean remove(Serializable key)
           
 boolean remove(Serializable key, boolean doNotNotifyCacheReplicators)
           
 void removeAll()
           
 void removeAll(boolean doNotNotifyCacheReplicators)
           
 void removeAll(Collection<?> keys)
           
 void removeAll(Collection<?> keys, boolean doNotNotifyCacheReplicators)
           
 
Methods inherited from class net.sf.ehcache.constructs.blocking.BlockingCache
get, getAllWithLoader, getCache, getLockForKey, getTimeoutMillis, getWithLoader, liveness, load, loadAll, put, put, putIfAbsent, putIfAbsent, putQuiet, putWithWriter, registerCacheLoader, setTimeoutMillis, unregisterCacheLoader
 
Methods inherited from class net.sf.ehcache.constructs.EhcacheDecoratorAdapter
acquireReadLockOnKey, acquireWriteLockOnKey, addPropertyChangeListener, bootstrap, calculateInMemorySize, calculateOffHeapSize, calculateOnDiskSize, clone, createQuery, disableDynamicFeatures, dispose, evictExpiredElements, flush, getAll, getBootstrapCacheLoader, getCacheConfiguration, getCacheEventNotificationService, getCacheExceptionHandler, getCacheManager, getDiskStoreSize, getGuid, getInternalContext, getKeys, getKeysNoDuplicateCheck, getKeysWithExpiryCheck, getMemoryStoreSize, getName, getOffHeapStoreSize, getQuiet, getQuiet, getRegisteredCacheExtensions, getRegisteredCacheLoaders, getRegisteredCacheWriter, getSearchAttribute, getSize, getStatistics, getStatus, getWriterManager, hasAbortedSizeOf, initialise, isClusterBulkLoadEnabled, isClusterCoherent, isDisabled, isElementInMemory, isElementInMemory, isElementOnDisk, isElementOnDisk, isExpired, isKeyInCache, isNodeBulkLoadEnabled, isNodeCoherent, isReadLockedByCurrentThread, isSearchable, isValueInCache, isWriteLockedByCurrentThread, putAll, recalculateSize, registerCacheExtension, registerCacheWriter, registerDynamicAttributesExtractor, releaseReadLockOnKey, releaseWriteLockOnKey, removeAndReturnElement, removeElement, removePropertyChangeListener, removeQuiet, removeQuiet, removeWithWriter, replace, replace, setBootstrapCacheLoader, setCacheExceptionHandler, setCacheManager, setDisabled, setName, setNodeBulkLoadEnabled, setNodeCoherent, setTransactionManagerLookup, toString, tryReadLockOnKey, tryWriteLockOnKey, unregisterCacheExtension, unregisterCacheWriter, waitUntilClusterBulkLoadComplete, waitUntilClusterCoherent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoadingCache

public LoadingCache(net.sf.ehcache.Ehcache cache,
                    CacheLoader<K,V> loader)
             throws net.sf.ehcache.CacheException
Throws:
net.sf.ehcache.CacheException
Method Detail

get

public net.sf.ehcache.Element get(Object key)
Specified by:
get in interface net.sf.ehcache.Ehcache
Overrides:
get in class net.sf.ehcache.constructs.blocking.BlockingCache

remove

public boolean remove(Serializable key,
                      boolean doNotNotifyCacheReplicators)
Specified by:
remove in interface net.sf.ehcache.Ehcache
Overrides:
remove in class net.sf.ehcache.constructs.EhcacheDecoratorAdapter

remove

public boolean remove(Serializable key)
Specified by:
remove in interface net.sf.ehcache.Ehcache
Overrides:
remove in class net.sf.ehcache.constructs.EhcacheDecoratorAdapter

remove

public boolean remove(Object key)
Specified by:
remove in interface net.sf.ehcache.Ehcache
Overrides:
remove in class net.sf.ehcache.constructs.EhcacheDecoratorAdapter

remove

public boolean remove(Object key,
                      boolean doNotNotifyCacheReplicators)
Specified by:
remove in interface net.sf.ehcache.Ehcache
Overrides:
remove in class net.sf.ehcache.constructs.EhcacheDecoratorAdapter

removeAll

public void removeAll(Collection<?> keys)
Specified by:
removeAll in interface net.sf.ehcache.Ehcache
Overrides:
removeAll in class net.sf.ehcache.constructs.EhcacheDecoratorAdapter

removeAll

public void removeAll(Collection<?> keys,
                      boolean doNotNotifyCacheReplicators)
Specified by:
removeAll in interface net.sf.ehcache.Ehcache
Overrides:
removeAll in class net.sf.ehcache.constructs.EhcacheDecoratorAdapter

removeAll

public void removeAll()
Specified by:
removeAll in interface net.sf.ehcache.Ehcache
Overrides:
removeAll in class net.sf.ehcache.constructs.EhcacheDecoratorAdapter

removeAll

public void removeAll(boolean doNotNotifyCacheReplicators)
Specified by:
removeAll in interface net.sf.ehcache.Ehcache
Overrides:
removeAll in class net.sf.ehcache.constructs.EhcacheDecoratorAdapter


Copyright © 2015 Atlassian. All rights reserved.