Elements and are managed
by the CacheManager. The Cache performs logical actions. It delegates physical
implementations to its net.sf.ehcache.store.Store s.
A reference to a Cache can be obtained through the CacheManager. A Cache thus obtained
is guaranteed to have status Status#STATUS_ALIVE. This status is checked for any method which
throws IllegalStateException and the same thrown if it is not alive. This would normally
happen if a call is made after CacheManager#shutdown is invoked.
Cache is threadsafe.
Statistics on cache usage are collected and made available through the getStatistics() methods.
Various decorators are available for Cache, such as BlockingCache, SelfPopulatingCache and the dynamic proxy ExceptionHandlingDynamicCacheProxy. See each class for details.
| Modifier and Type | Class and Description |
|---|---|
| private static class | Cache.CacheStatus
Private class maintaining status of the cache |
| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean | |
| private static final int | BACK_OFF_TIME_MILLIS
The amount of time to wait if a store gets backed up |
| private volatile BootstrapCacheLoader | |
| private volatile CacheExceptionHandler | |
| private volatile CacheManager | |
| private final Cache. | |
| private volatile CacheWriterManager | |
| private final AtomicBoolean | |
| private final ReentrantLock | |
| private CacheClusterStateStatisticsListener | |
| private volatile Store | compoundStore
The |
| private AbstractCacheConfigurationListener | |
| private final CacheConfiguration | |
| public static final String | DEFAULT_CACHE_NAME
A reserved word for cache names. |
| private static final int | |
| public static final long | DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS
The default interval between runs of the expiry thread. |
| private volatile boolean | |
| private static final String | |
| private volatile ElementValueComparator | |
| private static final int | |
| private static final int | |
| private static final int | |
| private volatile ExecutorService | executorService
A ThreadPoolExecutor which uses a thread pool to schedule loads in the order in which they are requested. |
| private final OperationObserver | |
| private final OperationObserver | |
| private final String | |
| private static InetAddress | |
| private volatile CacheLockProvider | |
| private static final Logger | |
| public static final String | NET_SF_EHCACHE_DISABLED
System Property based method of disabling ehcache. |
| public static final String | NET_SF_EHCACHE_USE_CLASSIC_LRU
System Property based method of selecting the LruMemoryStore in use up to ehcache 1.5. |
| private final PropertyChangeSupport | |
| private final OperationObserver | |
| private final OperationObserver | |
| private final OperationObserver | |
| private final List | |
| private final List | |
| private volatile CacheWriter | |
| private volatile RegisteredEventListeners | |
| private final OperationObserver | |
| private final OperationObserver | |
| private final OperationObserver | |
| private final OperationObserver | |
| private final OperationObserver | |
| private final OperationObserver | |
| private StatisticsGateway | |
| private volatile TransactionManagerLookup | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | Cache(CacheConfiguration
the configuration that should be used to create the cache with cacheConfiguration)2.0 and higher Constructor
The |
| public | Cache(CacheConfiguration
the configuration that should be used to create the cache with cacheConfiguration, RegisteredEventListeners a notification service. Optionally null, in which case a new one with no registered listeners will be created. registeredEventListeners, BootstrapCacheLoader the BootstrapCacheLoader to use to populate the cache when it is first initialised. Null if none is required. bootstrapCacheLoader)2.0 and higher Constructor
The |
| public | Cache(String
the name of the cache. Note that "default" is a reserved name for the defaultCache. name, int the maximum number of elements in memory, before they are evicted (0 == no limit) maxElementsInMemory, boolean whether to use the disk store overflowToDisk, boolean whether the elements in the cache are eternal, i.e. never expire eternal, long the default amount of time to live for an element from its creation date timeToLiveSeconds, long the default amount of time to live for an element from its last accessed or modified date timeToIdleSeconds)1.0 Constructor. |
| public | Cache(String
the name of the cache. Note that "default" is a reserved name for the defaultCache. name, int the maximum number of elements in memory, before they are evicted (0 == no limit) maxElementsInMemory, boolean whether to use the disk store overflowToDisk, boolean whether the elements in the cache are eternal, i.e. never expire eternal, long the default amount of time to live for an element from its creation date timeToLiveSeconds, long the default amount of time to live for an element from its last accessed or modified date timeToIdleSeconds, boolean whether to persist the cache to disk between JVM restarts diskPersistent, long how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended diskExpiryThreadIntervalSeconds)1.1 Constructor. |
| public | Cache(String
the name of the cache. Note that "default" is a reserved name for the defaultCache. name, int the maximum number of elements in memory, before they are evicted (0 == no limit) maxElementsInMemory, MemoryStoreEvictionPolicy one of LRU, LFU and FIFO. Optionally null, in which case it will be set to LRU. memoryStoreEvictionPolicy, boolean whether to use the disk store overflowToDisk, String this parameter is ignored. CacheManager sets it using setter injection. diskStorePath, boolean whether the elements in the cache are eternal, i.e. never expire eternal, long the default amount of time to live for an element from its creation date timeToLiveSeconds, long the default amount of time to live for an element from its last accessed or modified date timeToIdleSeconds, boolean whether to persist the cache to disk between JVM restarts diskPersistent, long how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended diskExpiryThreadIntervalSeconds, RegisteredEventListeners a notification service. Optionally null, in which case a new
one with no registered listeners will be created. registeredEventListeners)1.2 Constructor
The |
| public | Cache(String
the name of the cache. Note that "default" is a reserved name for the defaultCache. name, int the maximum number of elements in memory, before they are evicted (0 == no limit) maxElementsInMemory, MemoryStoreEvictionPolicy one of LRU, LFU and FIFO. Optionally null, in which case it will be set to LRU. memoryStoreEvictionPolicy, boolean whether to use the disk store overflowToDisk, String this parameter is ignored. CacheManager sets it using setter injection. diskStorePath, boolean whether the elements in the cache are eternal, i.e. never expire eternal, long the default amount of time to live for an element from its creation date timeToLiveSeconds, long the default amount of time to live for an element from its last accessed or modified date timeToIdleSeconds, boolean whether to persist the cache to disk between JVM restarts diskPersistent, long how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended diskExpiryThreadIntervalSeconds, RegisteredEventListeners a notification service. Optionally null, in which case a new one with no registered listeners will be created. registeredEventListeners, BootstrapCacheLoader the BootstrapCacheLoader to use to populate the cache when it is first initialised. Null if none is required. bootstrapCacheLoader)1.2.1 Constructor
The |
| public | Cache(String
the name of the cache. Note that "default" is a reserved name for the defaultCache. name, int the maximum number of elements in memory, before they are evicted (0 == no limit) maxElementsInMemory, MemoryStoreEvictionPolicy one of LRU, LFU and FIFO. Optionally null, in which case it will be set to LRU. memoryStoreEvictionPolicy, boolean whether to use the disk store overflowToDisk, String this parameter is ignored. CacheManager sets it using setter injection. diskStorePath, boolean whether the elements in the cache are eternal, i.e. never expire eternal, long the default amount of time to live for an element from its creation date timeToLiveSeconds, long the default amount of time to live for an element from its last accessed or modified date timeToIdleSeconds, boolean whether to persist the cache to disk between JVM restarts diskPersistent, long how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended diskExpiryThreadIntervalSeconds, RegisteredEventListeners a notification service. Optionally null, in which case a new one with no registered listeners will be created. registeredEventListeners, BootstrapCacheLoader the BootstrapCacheLoader to use to populate the cache when it is first initialised. Null if none is required. bootstrapCacheLoader, int the maximum number of Elements to allow on the disk. 0 means unlimited. maxElementsOnDisk)1.2.4 Constructor
The |
| public | Cache(String
the name of the cache. Note that "default" is a reserved name for the defaultCache. name, int the maximum number of elements in memory, before they are evicted (0 == no limit) maxElementsInMemory, MemoryStoreEvictionPolicy one of LRU, LFU and FIFO. Optionally null, in which case it will be set to LRU. memoryStoreEvictionPolicy, boolean whether to use the disk store overflowToDisk, String this parameter is ignored. CacheManager sets it using setter injection. diskStorePath, boolean whether the elements in the cache are eternal, i.e. never expire eternal, long the default amount of time to live for an element from its creation date timeToLiveSeconds, long the default amount of time to live for an element from its last accessed or modified date timeToIdleSeconds, boolean whether to persist the cache to disk between JVM restarts diskPersistent, long how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended diskExpiryThreadIntervalSeconds, RegisteredEventListeners a notification service. Optionally null, in which case a new one with no registered listeners will be created. registeredEventListeners, BootstrapCacheLoader the BootstrapCacheLoader to use to populate the cache when it is first initialised. Null if none is required. bootstrapCacheLoader, int the maximum number of Elements to allow on the disk. 0 means unlimited. maxElementsOnDisk, int the amount of memory to allocate the write buffer for puts to the DiskStore. diskSpoolBufferSizeMB)1.3 Constructor
The |
| public | Cache(String
the name of the cache. Note that "default" is a reserved name for the defaultCache. name, int the maximum number of elements in memory, before they are evicted (0 == no limit) maxElementsInMemory, MemoryStoreEvictionPolicy one of LRU, LFU and FIFO. Optionally null, in which case it will be set to LRU. memoryStoreEvictionPolicy, boolean whether to use the disk store overflowToDisk, String this parameter is ignored. CacheManager sets it using setter injection. diskStorePath, boolean whether the elements in the cache are eternal, i.e. never expire eternal, long the default amount of time to live for an element from its creation date timeToLiveSeconds, long the default amount of time to live for an element from its last accessed or modified date timeToIdleSeconds, boolean whether to persist the cache to disk between JVM restarts diskPersistent, long how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended diskExpiryThreadIntervalSeconds, RegisteredEventListeners a notification service. Optionally null, in which case a new one with no registered listeners will be created. registeredEventListeners, BootstrapCacheLoader the BootstrapCacheLoader to use to populate the cache when it is first initialised. Null if none is required. bootstrapCacheLoader, int the maximum number of Elements to allow on the disk. 0 means unlimited. maxElementsOnDisk, int the amount of memory to allocate the write buffer for puts to the DiskStore. diskSpoolBufferSizeMB, boolean whether the in-memory storage should be cleared when clearOnFlush)flush() is called on the cache1.6.0 Constructor
The |
| public | Cache(String
the name of the cache. Note that "default" is a reserved name for the defaultCache. name, int the maximum number of elements in memory, before they are evicted (0 == no limit) maxElementsInMemory, MemoryStoreEvictionPolicy one of LRU, LFU and FIFO. Optionally null, in which case it will be set to LRU. memoryStoreEvictionPolicy, boolean whether to use the disk store overflowToDisk, String this parameter is ignored. CacheManager sets it using setter injection. diskStorePath, boolean whether the elements in the cache are eternal, i.e. never expire eternal, long the default amount of time to live for an element from its creation date timeToLiveSeconds, long the default amount of time to live for an element from its last accessed or modified date timeToIdleSeconds, boolean whether to persist the cache to disk between JVM restarts diskPersistent, long how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended diskExpiryThreadIntervalSeconds, RegisteredEventListeners a notification service. Optionally null, in which case a new one with no registered listeners will be created. registeredEventListeners, BootstrapCacheLoader the BootstrapCacheLoader to use to populate the cache when it is first initialised. Null if none is required. bootstrapCacheLoader, int the maximum number of Elements to allow on the disk. 0 means unlimited. maxElementsOnDisk, int the amount of memory to allocate the write buffer for puts to the DiskStore. diskSpoolBufferSizeMB, boolean whether the in-memory storage should be cleared when clearOnFlush, boolean flush() is called on the cachewhether to cluster this cache with Terracotta isTerracottaClustered, boolean whether this cache should use coherent reads (usually should be true) unless optimizing for read-only terracottaCoherentReads)1.7.0 Constructor
The |
| pack-priv | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | acquireReadLockOnKey(Object
- The key that retrieves a value that you want to protect via locking key)Implements net. |
| public void | acquireWriteLockOnKey(Object
- The key that retrieves a value that you want to protect via locking key)Implements net. |
| public synchronized void | addPropertyChangeListener(PropertyChangeListener
the listener)PropertyChangeListener to addImplements net. |
| private void | |
| pack-priv Future | Returns: a Future which can be used to monitor executionthe key to load key, final CacheLoader a specific loader to use. If null the default loader is used. specificLoader, final Object the argument to pass to the writer argument)Does the asynchronous loading. |
| pack-priv Future | Returns: a Future which can be used to monitor executionthe loader argument argument)Creates a future to perform the load |
| pack-priv Future | Returns: a Future which can be used to monitor executionthe key to load key, final CacheLoader a specific loader to use. If null the default loader is used. specificLoader, final Object the argument to pass to the writer argument)Does the asynchronous put into the cache of the asynchronously loaded value. |
| private void | backOffIfDiskSpoolFull()
wait outside of synchronized block so as not to block readers If the disk store spool is full wait a short time to give it a chance to catch up. |
| public void | |
| public final long | Returns: the approximate size of the memory store in bytesImplements net.
Deprecated
Gets the size of the memory store for this cache.
|
| public final long | Returns: the size of the off-heap store in bytesImplements net.
Deprecated
Gets the size of the off-heap store for this cache.
|
| public final long | Returns: the size of the on-disk store in bytesImplements net.
Deprecated
Gets the size of the on-disk store for this cache
|
| private void | |
| private void | |
| private void | |
| private static void | |
| private void | |
| private boolean | |
| public final Cache | Returns: an object of typeCacheOverrides java. Implements net. |
| public void | clusterCoherent(boolean
if the cluster is coherent clusterCoherent)Implements net. |
| private static final BootstrapCacheLoader | Returns: If there is none returns null.Tries to load a BootstrapCacheLoader from the class specified. |
| private static CacheEventListener | createCacheEventListener(CacheConfiguration.
Tries to load the class specified otherwise defaults to null. |
| private static CacheExtension | createCacheExtension(CacheConfiguration.
Tries to load the class specified otherwise defaults to null. |
| private static CacheLoader | createCacheLoader(CacheConfiguration.
Tries to load the class specified otherwise defaults to null. |
| private static CacheWriter | createCacheWriter(CacheWriterConfiguration config, Ehcache cache, ClassLoader loader)
Tries to load the class specified otherwise defaults to null. |
| protected DiskStore | Returns: the disk storeCreates a disk store when either:
|
| private String | |
| public Query | createQuery()
Implements net. |
| public void | disableDynamicFeatures()
Implements net. |
| public synchronized void | |
| private void | |
| private void | |
| private void | |
| public boolean | Returns: true if this object is the same as the obj
argument; false otherwise.the reference object with which to compare. object)Overrides java. Object#equals(Object)
An Cache is equal to another one if it implements Ehcache and has the same GUID. |
| public void | evictExpiredElements()
Implements net. |
| pack-priv Results | |
| public void | firePropertyChange(String
the name of the property that changed propertyName, Object the old value of the property that changed oldValue, Object the new value of the property that changed newValue)
|
| public final synchronized void | flush()
Implements net. |
| public final Element | Returns: the element, or null, if it does not exist.a serializable value. Null keys are not stored so get(null) always returns null key)Implements net. |
| public final Element | Returns: the element, or null, if it does not exist.an Object value key)Implements net. |
| public Map | getAll(Collection<?>
a collection of keys for which value is to be fetched keys)Implements net. |
| public Map | Returns: a Map populated from the Cache. If there are no elements, an empty Map is returned.a collection of keys to be returned/loaded keys, Object an argument to pass to the CacheLoader. loaderArgument)Implements net. |
| public BootstrapCacheLoader | getBootstrapCacheLoader()
Implements net. |
| private CacheCluster | |
| public CacheConfiguration | getCacheConfiguration()
Implements net. |
| public final RegisteredEventListeners | Returns: the RegisteredEventListeners instance for this cache.Implements net. |
| public CacheExceptionHandler | getCacheExceptionHandler()
Implements net. |
| public final CacheManager | Returns: the manager or null if there is noneImplements net. |
| public final int | Returns: the number of elements in the disk store.Implements net.
Deprecated
Returns the number of elements in the disk store.
|
| pack-priv ExecutorService | |
| public final String | Returns: the globally unique identifier for this cache instance. This is guaranteed to be unique.Implements net. |
| public Object | |
| public final List | Returns: a list ofObject keysImplements net. |
| public final List | Returns: a list ofObject keysImplements net. |
| public final List | Returns: a list ofObject keysImplements net. |
| protected Sync | Returns: the lock object for the passed in keythe key we want the lock for key)Gets the lock for a given key |
| public Policy | Returns: the current in-memory eviction policy. This may not be the configured policy, if it has been dynamically set.
|
| public final long | Returns: the number of elements in the memory storeImplements net.
Deprecated
Returns the number of elements in the memory store.
|
| public final String | |
| public long | Returns: the number of elements in the off-heap storeImplements net.
Deprecated
Returns the number of elements in the off-heap store.
|
| public final Element | Returns: the element, or null, if it does not exist.a serializable value key)Implements net. |
| public final Element | Returns: the element, or null, if it does not exist.a serializable value key)Implements net. |
| public List | Returns: the cache extensions as a live listImplements net. |
| public List | Returns: the cache loaders as a live listImplements net. |
| public CacheWriter | getRegisteredCacheWriter()
Implements net. CacheWriter that was registered for this cache.
|
| public <T> Attribute | getSearchAttribute(String
the name of the attribute to retrieve attributeName)Implements net. |
| public Set | Returns: set of all search attributes in effect at the time of calling this methodImplements net. |
| public final int | Returns: The size valueImplements net. |
| public StatisticsGateway | getStatistics()
Implements net. |
| public final Status | Returns: The status value from the Status enum classImplements net. |
| pack-priv final Store | |
| public final Object | |
| public TransactionManagerLookup | Returns: Thenet. instanceGet the TransactionManagerLookup implementation used to lookup the TransactionManager. |
| public Element | Returns: an element if it existed or could be loaded, otherwise nullkey whose associated value is to be returned. key, CacheLoader the override loader to use. If null, the cache's default loader will be used loader, Object an argument to pass to the CacheLoader. loaderArgument)Implements net. |
| public CacheWriterManager | getWriterManager()
Implements net. |
| private void | |
| private Store | |
| public boolean | hasAbortedSizeOf()
Implements net. |
| public int | Returns: a hash code value for this object.Overrides java. |
| public void | initialise()
Implements net. net..
|
| private void | initialiseCacheWriterManager(boolean
indicates whether it's imperative for the cache writer manager to be initialised before operations can continue imperative)The CacheWriterManager's initialisation can be deferred until an actual CacheWriter has been registered. |
| private void | |
| private void | |
| private void | |
| public boolean | isClusterBulkLoadEnabled()
Implements net. |
| public boolean | isClusterCoherent()
Implements net.
Deprecated
use
Returns true if the cache is in coherent mode cluster-wide.
isClusterBulkLoadEnabled() instead
|
| public boolean | Returns: true if the cache is disabled.Implements net. |
| protected boolean | Returns: true if the cache either overflows to disk or uses a local-classic persistence strategy.Whether this cache uses a disk store |
| public final boolean | Returns: true if an element matching the key is found in memorythe key of the element to remove key)Implements net. |
| public final boolean | Returns: true if an element matching the key is found in memorythe key of the element to remove key)Implements net. |
| public final boolean | Returns: true if an element matching the key is found in off-heapkey to look for key)Whether an Element is stored in the cache in off-heap memory, indicating an intermediate cost of retrieval. |
| public final boolean | Returns: true if an element matching the key is found in the diskStorekey to look for key)Implements net. |
| public final boolean | Returns: true if an element matching the key is found in the diskStorekey to look for key)Implements net. |
| public final boolean | Returns: true if it has expiredthe element to check element)Implements net. |
| public boolean | Returns: true if an Element matching the key is found in the cache. No assertions are made about the state of the Element.the key to check. key)Implements net. |
| public boolean | isNodeBulkLoadEnabled()
Implements net. |
| public boolean | isNodeCoherent()
Implements net.
Deprecated
use
Returns true if the cache is in coherent mode for the current node.
isNodeBulkLoadEnabled() instead
|
| public boolean | isReadLockedByCurrentThread(Object
the key key)Implements net. Only Terracotta clustered cache instances currently support querying a thread's read lock hold status. |
| public boolean | |
| public boolean | Returns: true when the cache is clustered by Terracotta; or false otherwiseIndicates whether this cache is clustered by Terracotta |
| public boolean | Returns: true if an Element matching the key is found in the cache. No assertions are made about the state of the Element.to check for value)Implements net. |
| public boolean | isWriteLockedByCurrentThread(Object
the key key)Implements net. |
| public void | load(final Object
key whose associated value to be loaded using the associated CacheLoader if this cache doesn't contain it. key)Implements net. |
| public void | loadAll(final Collection<E>
- collection of the keys whose associated values to be loaded into this cache by using the associated
cacheloader if this cache doesn't contain them. keys, final Object can be anything that makes sense to the loader
argument)
The Ehcache native API provides similar functionality to loaders using the
decorator Implements net. |
| private Object | Returns: null if not present in the underlying SoR or if no loader available, otherwise the loaded objectthe key to load for key, final CacheLoader the loader to use, can be null to fallback to Cache registered loaders specificLoader, final Object the argument to pass the loader argument)Will attempt to load the value for a key, either using the passedin loader, or falling back to registered ones |
| private Object | |
| pack-priv Map | Returns: A map of loaded elementsthe loader argument argument, Set<Object> the Set of keys that are already in the Cache nonLoadedKeys)Does the asynchronous loading. |
| private void | |
| private TerracottaStore | makeClusteredTransactionalIfNeeded(final TerracottaStore store, final ElementValueComparator comparator, ClassLoader loader)
|
| private AbstractTransactionStore | |
| private void | notifyPutInternalListeners(Element element, boolean doNotNotifyCacheReplicators, boolean elementExists)
|
| private boolean | notifyRemoveInternalListeners(Object key, boolean expiry, boolean notifyListeners, boolean doNotNotifyCacheReplicators, Element elementFromStore)
|
| public final void | put(Element
A cache Element. If Serializable it can fully participate in replication and the DiskStore. If it is
element)null or the key is null, it is ignored as a NOOP.Implements net. |
| public final void | put(Element
A cache Element. If Serializable it can fully participate in replication and the DiskStore. If it is
element, boolean null or the key is null, it is ignored as a NOOP.whether the put is coming from a doNotNotifyCacheReplicators cache peer, in which case this put should not initiate a
further notification to doNotNotifyCacheReplicators cache peers doNotNotifyCacheReplicators)Implements net. |
| public void | putAll(Collection<Element>
the collection of elements to be put in the cache. elements)Implements net. |
| private void | |
| private void | |
| public Element | putIfAbsent(Element
element to be added element)Implements net. |
| public Element | putIfAbsent(Element
element to be added element, boolean whether the put is coming from a doNotNotifyCacheReplicators cache peer, in which case this put should not initiate a
further notification to doNotNotifyCacheReplicators cache peers doNotNotifyCacheReplicators)Implements net. |
| private void | |
| public final void | putQuiet(Element
A cache Element. If Serializable it can fully participate in replication and the DiskStore. If it is
element)null or the key is null, it is ignored as a NOOP.Implements net. |
| public void | putWithWriter(Element
An object. If Serializable it can fully participate in replication and the DiskStore. element)Implements net. |
| public void | recalculateSize(Object
the key key)Implements net. |
| public void | registerCacheExtension(CacheExtension
the cache extension cacheExtension)Implements net. CacheExtension with the cache.
|
| private static void | registerCacheExtensions(CacheConfiguration
the cache configuration cacheConfiguration, Ehcache the cache cache, ClassLoader loader)A factory method to register cache extensions |
| private static void | registerCacheListeners(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, ClassLoader loader)
A factory method to create a RegisteredEventListeners |
| public void | registerCacheLoader(CacheLoader
A Cache Loader to register cacheLoader)Implements net. CacheLoader with the cache.
|
| private static void | registerCacheLoaders(CacheConfiguration
the cache configuration cacheConfiguration, Ehcache the cache cache, ClassLoader loader)A factory method to register cache Loaders |
| private static void | registerCacheWriter(CacheConfiguration
the cache configuration cacheConfiguration, Ehcache the cache cache, ClassLoader loader)A factory method to register cache writers |
| public void | registerCacheWriter(CacheWriter
A CacheWriter to register cacheWriter)Implements net. CacheWriter for this cache.
|
| public void | registerDynamicAttributesExtractor(DynamicAttributesExtractor
the dynamic attribute extractor extractor)Implements net. |
| private void | |
| public void | releaseReadLockOnKey(Object
- The key that retrieves a value that you want to protect via locking key)Implements net. |
| public void | releaseWriteLockOnKey(Object
- The key that retrieves a value that you want to protect via locking key)Implements net. |
| public final boolean | Returns: true if the element was removed, false if it was not found in the cachethe element key to operate on key)Implements net. Element from the Cache.
|
| public final boolean | Returns: true if the element was removed, false if it was not found in the cachethe element key to operate on key)Implements net. Element from the Cache.
|
| public final boolean | Returns: true if the element was removed, false if it was not found in the cachethe element key to operate on key, boolean whether the remove is coming from a doNotNotifyCacheReplicators cache peer, in which case this remove should not initiate a
further notification to doNotNotifyCacheReplicators cache peers doNotNotifyCacheReplicators)Implements net. Element from the Cache.
|
| public final boolean | Returns: true if the element was removed, false if it was not found in the cachethe element key to operate on key, boolean whether the remove is coming from a doNotNotifyCacheReplicators cache peer, in which case this remove should not initiate a
further notification to doNotNotifyCacheReplicators cache peers doNotNotifyCacheReplicators)Implements net. Element from the Cache.
|
| public void | removeAll(final Collection<?>
a collection of keys to operate on keys)Implements net. net. from the Cache.
|
| public final void | removeAll(final Collection<?>
a collection of keys to operate on keys, boolean whether the put is coming from a doNotNotifyCacheReplicators cache peer,
in which case this put should not initiate a further notification to doNotNotifyCacheReplicators cache peers doNotNotifyCacheReplicators)Implements net. |
| public void | |
| public void | removeAll(boolean
whether the put is coming from a doNotNotifyCacheReplicators cache peer,
in which case this put should not initiate a further notification to doNotNotifyCacheReplicators cache peers doNotNotifyCacheReplicators)Implements net. |
| private void | Returns: true if the element was removed, false if it was not found in the cachea collection of keys to operate on keys, boolean if the reason this method is being called is to expire the element expiry, boolean whether to notify listeners notifyListeners, boolean whether not to notify cache replicators doNotNotifyCacheReplicators)Removes or expires a collection of |
| public final Element | Returns: element the removed element associated with the key, null if no mapping existsthe element key to operate on key)Implements net. Element from the Cache and returns it.
|
| public boolean | removeElement(Element
Element to be removed element)Implements net. |
| private Element | Returns: element if the element was removed, null if it was not found in the cachethe element key to operate on key, boolean if the reason this method is being called is to expire the element expiry, boolean whether to notify listeners notifyListeners, boolean whether not to notify cache replicators doNotNotifyCacheReplicators, boolean if the element should else be removed from the cache writer useCacheWriter)Removes or expires an |
| public synchronized void | removePropertyChangeListener(PropertyChangeListener
the listener)PropertyChangeListener to removeImplements net. |
| public final boolean | Returns: true if the element was removed, false if it was not found in the cachethe element key to operate on key)Implements net. Element from the Cache, without notifying listeners.
|
| public final boolean | Returns: true if the element was removed, false if it was not found in the cachethe element key to operate on key)Implements net. Element from the Cache, without notifying listeners.
|
| public boolean | removeWithWriter(Object
of the element to remove key)Implements net. net. from the Cache and any stores it might be in. This also removes through
to a CacheWriter.
|
| public boolean | replace(Element
Element to be test against old, Element Element to be cached element)Implements net. |
| public Element | replace(Element
Element to be cached element)Implements net. |
| public void | setBootstrapCacheLoader(BootstrapCacheLoader
the loader to be used bootstrapCacheLoader)Implements net. |
| public void | setCacheExceptionHandler(CacheExceptionHandler
the cache exception handler cacheExceptionHandler)Implements net. |
| public void | setCacheManager(CacheManager
the CacheManager for this cache to use. cacheManager)Implements net. |
| public void | setDisabled(boolean
true if you wish to disable, false to enable disabled)Implements net. |
| public void | |
| public final void | setName(String
the name of the cache. Should not be null. Should also not contain any '/' characters, as these interfere
with distribution name)Implements net. |
| public void | setNodeBulkLoadEnabled(boolean
true enables bulk-load, false disables it if not already disabled enabledBulkLoad)Implements net. |
| public void | setNodeCoherent(boolean
true transitions to coherent mode, false to incoherent mode coherent)Implements net.
Deprecated
use
Sets the cache in coherent or incoherent mode depending on the parameter on this node.
setNodeBulkLoadEnabled(boolean) instead
|
| public void | setTransactionManagerLookup(TransactionManagerLookup lookup)
Implements net. Cache#initialise() is called
|
| private boolean | |
| public String | toString()
Overrides java. Implements net. String representation of Cache.
|
| public boolean | Returns: whether the lock was awarded- The key that retrieves a value that you want to protect via locking key, long - millis until giveup on getting the lock timeout)Implements net. |
| private void | tryRemoveImmediately(final Object key, final boolean notifyListeners)
Deprecated
This shouldn't be necessary once we got rid of this stupid locking layer!
|
| public boolean | Returns: whether the lock was awarded- The key that retrieves a value that you want to protect via locking key, long - millis until giveup on getting the lock timeout)Implements net. |
| public void | unregisterCacheExtension(CacheExtension
the cache extension cacheExtension)Implements net. CacheExtension with the cache.
|
| public void | unregisterCacheLoader(CacheLoader
A Cache Loader to unregister cacheLoader)Implements net. CacheLoader with the cache.
|
| public void | unregisterCacheWriter()
Implements net. CacheWriter from the cache.
|
| private void | |
| public void | waitUntilClusterBulkLoadComplete()
Implements net. |
| public void | waitUntilClusterCoherent()
Implements net.
Deprecated
use
This method waits until the cache is in coherent mode in all the connected nodes.
waitUntilClusterBulkLoadComplete() instead
|