Class InternalClassLoaderAwareCache
- java.lang.Object
-
- net.sf.ehcache.constructs.classloader.ClassLoaderAwareCache
-
- net.sf.ehcache.constructs.classloader.InternalClassLoaderAwareCache
-
- All Implemented Interfaces:
java.lang.Cloneable,Ehcache,InternalEhcache
public class InternalClassLoaderAwareCache extends ClassLoaderAwareCache implements InternalEhcache
Extension of Class Loader Aware cache to accommodate the removeAndReturnElement method.- Author:
- dhruv
-
-
Field Summary
-
Fields inherited from class net.sf.ehcache.constructs.classloader.ClassLoaderAwareCache
cache, classLoader
-
-
Constructor Summary
Constructors Constructor Description InternalClassLoaderAwareCache(InternalEhcache cache, java.lang.ClassLoader classLoader)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrecalculateSize(java.lang.Object arg0)Recalculate the size of the element mapped to the keyElementremoveAndReturnElement(java.lang.Object arg0)Removes and returns the element associated with the key-
Methods inherited from class net.sf.ehcache.constructs.classloader.ClassLoaderAwareCache
acquireReadLockOnKey, acquireWriteLockOnKey, addPropertyChangeListener, bootstrap, calculateInMemorySize, calculateOffHeapSize, calculateOnDiskSize, clone, createQuery, disableDynamicFeatures, dispose, evictExpiredElements, flush, get, get, getAll, getAllWithLoader, getBootstrapCacheLoader, getCacheConfiguration, getCacheEventNotificationService, getCacheExceptionHandler, getCacheManager, getDiskStoreSize, getGuid, getInternalContext, getKeys, getKeysNoDuplicateCheck, getKeysWithExpiryCheck, getMemoryStoreSize, getName, getOffHeapStoreSize, getQuiet, getQuiet, getRegisteredCacheExtensions, getRegisteredCacheLoaders, getRegisteredCacheWriter, getSearchAttribute, getSearchAttributes, getSize, getStatistics, getStatus, getWithLoader, getWriterManager, hasAbortedSizeOf, initialise, isClusterBulkLoadEnabled, isClusterCoherent, isDisabled, isElementInMemory, isElementInMemory, isElementOnDisk, isElementOnDisk, isExpired, isKeyInCache, isNodeBulkLoadEnabled, isNodeCoherent, isReadLockedByCurrentThread, isSearchable, isValueInCache, isWriteLockedByCurrentThread, load, loadAll, main, put, put, putAll, putIfAbsent, putIfAbsent, putQuiet, putWithWriter, registerCacheExtension, registerCacheLoader, registerCacheWriter, registerDynamicAttributesExtractor, releaseReadLockOnKey, releaseWriteLockOnKey, remove, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeElement, removePropertyChangeListener, removeQuiet, removeQuiet, removeWithWriter, replace, replace, setBootstrapCacheLoader, setCacheExceptionHandler, setCacheManager, setDisabled, setName, setNodeBulkLoadEnabled, setNodeCoherent, setTransactionManagerLookup, toString, tryReadLockOnKey, tryWriteLockOnKey, unregisterCacheExtension, unregisterCacheLoader, unregisterCacheWriter, waitUntilClusterBulkLoadComplete, waitUntilClusterCoherent
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.ehcache.Ehcache
acquireReadLockOnKey, acquireWriteLockOnKey, addPropertyChangeListener, bootstrap, calculateInMemorySize, calculateOffHeapSize, calculateOnDiskSize, clone, createQuery, disableDynamicFeatures, dispose, evictExpiredElements, flush, get, get, getAll, getAllWithLoader, getBootstrapCacheLoader, getCacheConfiguration, getCacheEventNotificationService, getCacheExceptionHandler, getCacheManager, getDiskStoreSize, getGuid, getInternalContext, getKeys, getKeysNoDuplicateCheck, getKeysWithExpiryCheck, getMemoryStoreSize, getName, getOffHeapStoreSize, getQuiet, getQuiet, getRegisteredCacheExtensions, getRegisteredCacheLoaders, getRegisteredCacheWriter, getSearchAttribute, getSearchAttributes, getSize, getStatistics, getStatus, getWithLoader, getWriterManager, hasAbortedSizeOf, initialise, isClusterBulkLoadEnabled, isClusterCoherent, isDisabled, isElementInMemory, isElementInMemory, isElementOnDisk, isElementOnDisk, isExpired, isKeyInCache, isNodeBulkLoadEnabled, isNodeCoherent, isReadLockedByCurrentThread, isSearchable, isValueInCache, isWriteLockedByCurrentThread, load, loadAll, put, put, putAll, putIfAbsent, putIfAbsent, putQuiet, putWithWriter, registerCacheExtension, registerCacheLoader, registerCacheWriter, registerDynamicAttributesExtractor, releaseReadLockOnKey, releaseWriteLockOnKey, remove, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeElement, removePropertyChangeListener, removeQuiet, removeQuiet, removeWithWriter, replace, replace, setBootstrapCacheLoader, setCacheExceptionHandler, setCacheManager, setDisabled, setName, setNodeBulkLoadEnabled, setNodeCoherent, setTransactionManagerLookup, toString, tryReadLockOnKey, tryWriteLockOnKey, unregisterCacheExtension, unregisterCacheLoader, unregisterCacheWriter, waitUntilClusterBulkLoadComplete, waitUntilClusterCoherent
-
-
-
-
Constructor Detail
-
InternalClassLoaderAwareCache
public InternalClassLoaderAwareCache(InternalEhcache cache, java.lang.ClassLoader classLoader)
Constructor- Parameters:
cache- wrapped cacheclassLoader- loader to set Thread context loader to for duration of cache operation
-
-
Method Detail
-
removeAndReturnElement
public Element removeAndReturnElement(java.lang.Object arg0) throws java.lang.IllegalStateException
Removes and returns the element associated with the key- Specified by:
removeAndReturnElementin interfaceInternalEhcache- Parameters:
arg0- the key of the element to operate on- Returns:
- element the removed element associated with the key, null if no mapping exists
- Throws:
java.lang.IllegalStateException- if the cache is notStatus.STATUS_ALIVE
-
recalculateSize
public void recalculateSize(java.lang.Object arg0)
Recalculate the size of the element mapped to the key- Specified by:
recalculateSizein interfaceInternalEhcache- Parameters:
arg0- the key
-
-