Top Description Fields Constructors Methods
net.sf.ehcache.constructs.classloader

public Class InternalClassLoaderAwareCache

extends ClassLoaderAwareCache
implements InternalEhcache
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.terracotta.InternalEhcache, net.sf.ehcache.Ehcache, java.lang.Cloneable
Imports
net.sf.ehcache.Element, net.sf.ehcache.terracotta.InternalEhcache

Extension of Class Loader Aware cache to accommodate the removeAndReturnElement method.
Author
dhruv

Field Summary

Inherited from net.sf.ehcache.constructs.classloader.ClassLoaderAwareCache:
cacheclassLoader

Constructor Summary

AccessConstructor and Description
public
InternalClassLoaderAwareCache(InternalEhcache
wrapped cache
cache
,
ClassLoader
loader to set Thread context loader to for duration of cache operation
classLoader
)

Constructor

Method Summary

Modifier and TypeMethod and Description
public void
recalculateSize(Object
the key
arg0
)

Implements net.sf.ehcache.terracotta.InternalEhcache.recalculateSize.

Recalculate the size of the element mapped to the key
public Element
removeAndReturnElement(Object
the key of the element to operate on
arg0
)

Implements net.sf.ehcache.terracotta.InternalEhcache.removeAndReturnElement.

Removes and returns the element associated with the key
Inherited from net.sf.ehcache.constructs.classloader.ClassLoaderAwareCache:
acquireReadLockOnKeyacquireWriteLockOnKeyaddPropertyChangeListenerbootstrapcalculateInMemorySizecalculateOffHeapSizecalculateOnDiskSizeclonecreateQuerydisableDynamicFeaturesdisposeevictExpiredElementsflushgetgetgetAllgetAllWithLoadergetBootstrapCacheLoadergetCacheConfigurationgetCacheEventNotificationServicegetCacheExceptionHandlergetCacheManagergetDiskStoreSizegetGuidgetInternalContextgetKeysgetKeysNoDuplicateCheckgetKeysWithExpiryCheckgetMemoryStoreSizegetNamegetOffHeapStoreSizegetQuietgetQuietgetRegisteredCacheExtensionsgetRegisteredCacheLoadersgetRegisteredCacheWritergetSearchAttributegetSearchAttributesgetSizegetStatisticsgetStatusgetWithLoadergetWriterManagerhasAbortedSizeOfinitialiseisClusterBulkLoadEnabledisClusterCoherentisDisabledisElementInMemoryisElementInMemoryisElementOnDiskisElementOnDiskisExpiredisKeyInCacheisNodeBulkLoadEnabledisNodeCoherentisReadLockedByCurrentThreadisSearchableisValueInCacheisWriteLockedByCurrentThreadloadloadAllmainputputputAllputIfAbsentputIfAbsentputQuietputWithWriterregisterCacheExtensionregisterCacheLoaderregisterCacheWriterregisterDynamicAttributesExtractorreleaseReadLockOnKeyreleaseWriteLockOnKeyremoveremoveremoveremoveremoveAllremoveAllremoveAllremoveAllremoveElementremovePropertyChangeListenerremoveQuietremoveQuietremoveWithWriterreplacereplacesetBootstrapCacheLoadersetCacheExceptionHandlersetCacheManagersetDisabledsetNamesetNodeBulkLoadEnabledsetNodeCoherentsetTransactionManagerLookuptoStringtryReadLockOnKeytryWriteLockOnKeyunregisterCacheExtensionunregisterCacheLoaderunregisterCacheWriterwaitUntilClusterBulkLoadCompletewaitUntilClusterCoherent

Constructor Detail

InternalClassLoaderAwareCacheback to summary
public InternalClassLoaderAwareCache(InternalEhcache cache, ClassLoader classLoader)

Constructor

Parameters
cache:InternalEhcache

wrapped cache

classLoader:ClassLoader

loader to set Thread context loader to for duration of cache operation

Method Detail

recalculateSizeback to summary
public void recalculateSize(Object arg0)

Implements net.sf.ehcache.terracotta.InternalEhcache.recalculateSize.

Doc from net.sf.ehcache.terracotta.InternalEhcache.recalculateSize.

Recalculate the size of the element mapped to the key

Parameters
arg0:Object

the key

removeAndReturnElementback to summary
public Element removeAndReturnElement(Object arg0) throws IllegalStateException

Implements net.sf.ehcache.terracotta.InternalEhcache.removeAndReturnElement.

Doc from net.sf.ehcache.terracotta.InternalEhcache.removeAndReturnElement.

Removes and returns the element associated with the key

Parameters
arg0:Object

the key of the element to operate on

Returns:Element

element the removed element associated with the key, null if no mapping exists

Exceptions
IllegalStateException:
if the cache is not Status#STATUS_ALIVE