ehcache

net.sf.ehcache.constructs.classloader
Class InternalClassLoaderAwareCache

java.lang.Object
  extended by net.sf.ehcache.constructs.classloader.ClassLoaderAwareCache
      extended by net.sf.ehcache.constructs.classloader.InternalClassLoaderAwareCache
All Implemented Interfaces:
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
InternalClassLoaderAwareCache(InternalEhcache cache, ClassLoader classLoader)
          Constructor
 
Method Summary
 void recalculateSize(Object arg0)
          Recalculate the size of the element mapped to the key
 Element removeAndReturnElement(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,
                                     ClassLoader classLoader)
Constructor

Parameters:
cache - wrapped cache
classLoader - loader to set Thread context loader to for duration of cache operation
Method Detail

removeAndReturnElement

public Element removeAndReturnElement(Object arg0)
                               throws IllegalStateException
Removes and returns the element associated with the key

Specified by:
removeAndReturnElement in interface InternalEhcache
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:
IllegalStateException

recalculateSize

public void recalculateSize(Object arg0)
Recalculate the size of the element mapped to the key

Specified by:
recalculateSize in interface InternalEhcache
Parameters:
arg0 - the key

ehcache

Copyright 2001-2015, Terracotta, Inc.