Top Description Inners Fields Constructors Methods
net.sf.ehcache

public Class Cache

extends Object
implements InternalEhcache, StoreListener
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.store.StoreListener, java.util.EventListener, net.sf.ehcache.terracotta.InternalEhcache, net.sf.ehcache.Ehcache, java.lang.Cloneable
Imports
net.sf.ehcache.CacheOperationOutcomes.GetAllOutcome, .CacheOperationOutcomes.GetOutcome, .CacheOperationOutcomes.PutAllOutcome, .CacheOperationOutcomes.PutOutcome, .CacheOperationOutcomes.RemoveAllOutcome, .CacheOperationOutcomes.RemoveOutcome, .CacheOperationOutcomes.PutIfAbsentOutcome, .CacheOperationOutcomes.RemoveElementOutcome, .CacheOperationOutcomes.SearchOutcome, net.sf.ehcache.bootstrap.BootstrapCacheLoader, .BootstrapCacheLoaderFactory, net.sf.ehcache.cluster.CacheCluster, .ClusterScheme, .ClusterSchemeNotAvailableException, net.sf.ehcache.concurrent.CacheLockProvider, .LockType, .StripedReadWriteLockSync, .Sync, net.sf.ehcache.config.CacheConfiguration, .CacheWriterConfiguration, .DiskStoreConfiguration, .InvalidConfigurationException, .NonstopConfiguration, .PersistenceConfiguration, .PersistenceConfiguration.Strategy, .PinningConfiguration, .SearchAttribute, .TerracottaConfiguration, .TerracottaConfiguration.Consistency, .AbstractCacheConfigurationListener, net.sf.ehcache.constructs.nonstop.concurrency.LockOperationTimedOutNonstopException, net.sf.ehcache.event.CacheEventListener, .CacheEventListenerFactory, .RegisteredEventListeners, net.sf.ehcache.exceptionhandler.CacheExceptionHandler, net.sf.ehcache.extension.CacheExtension, .CacheExtensionFactory, net.sf.ehcache.loader.CacheLoader, .CacheLoaderFactory, net.sf.ehcache.pool.Pool, .PoolEvictor, .SizeOfEngine, net.sf.ehcache.pool.impl.BoundedPool, .FromLargestCachePoolEvictor, .UnboundedPool, net.sf.ehcache.search.Attribute, .Query, .Results, .SearchException, net.sf.ehcache.search.aggregator.AggregatorInstance, net.sf.ehcache.search.attribute.AttributeExtractor, .DynamicAttributesExtractor, .UnknownAttributeException, net.sf.ehcache.search.expression.BaseCriteria, net.sf.ehcache.statistics.StatisticsGateway, net.sf.ehcache.store.CopyingCacheStore, .ElementValueComparator, .LegacyStoreWrapper, .LruMemoryStore, .MemoryStore, .MemoryStoreEvictionPolicy, .Policy, .Store, .StoreListener, .StoreQuery, .StoreQuery.Ordering, .TerracottaStore, .TerracottaTransactionalCopyingCacheStore, .TxCopyingCacheStore, net.sf.ehcache.store.compound.ReadWriteSerializationCopyStrategy, net.sf.ehcache.store.disk.DiskStore, .StoreUpdateException, net.sf.ehcache.terracotta.InternalEhcache, .TerracottaNotRunningException, net.sf.ehcache.transaction.AbstractTransactionStore, .SoftLockManager, .TransactionIDFactory, net.sf.ehcache.transaction.local.JtaLocalTransactionStore, .LocalTransactionStore, net.sf.ehcache.transaction.manager.TransactionManagerLookup, net.sf.ehcache.transaction.xa.XATransactionStore, net.sf.ehcache.util.ClassLoaderUtil, .NamedThreadFactory, .PropertyUtil, .TimeUtil, .VmUtils, net.sf.ehcache.writer.CacheWriter, .CacheWriterFactory, .CacheWriterManager, .CacheWriterManagerException, org.slf4j.Logger, .LoggerFactory, org.terracotta.context.annotations.ContextAttribute, org.terracotta.statistics.StatisticsManager, org.terracotta.statistics.observer.OperationObserver, java.beans.PropertyChangeListener, .PropertyChangeSupport, java.io.IOException, .Serializable, java.net.InetAddress, .UnknownHostException, java.util.ArrayList, .Collection, .Collections, .HashMap, .HashSet, .Iterator, .List, .Map, .Map.Entry, .Properties, .Set, .UUID, java.util.concurrent.AbstractExecutorService, .Callable, .CopyOnWriteArrayList, .ExecutionException, .ExecutorService, .Future, .LinkedBlockingQueue, .ThreadPoolExecutor, .TimeUnit, .TimeoutException, java.util.concurrent.atomic.AtomicBoolean, .AtomicReference, java.util.concurrent.locks.ReentrantLock

Cache is the central class in ehcache. Caches have Elements and are managed by the CacheManager. The Cache performs logical actions. It delegates physical implementations to its net.sf.ehcache.store.Stores.

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.

Authors
Greg Luck, Geert Bevin
Version
$Id: Cache.java 11185 2019-11-25 10:56:55Z tchakra $

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
Cache.CacheStatus

Private class maintaining status of the cache

Field Summary

Modifier and TypeField 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.CacheStatus
private volatile CacheWriterManager
private final AtomicBoolean
private final ReentrantLock
private CacheClusterStateStatisticsListener
private volatile Store
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<CacheOperationOutcomes.GetAllOutcome>
private final OperationObserver<CacheOperationOutcomes.GetOutcome>
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<CacheOperationOutcomes.PutAllOutcome>
private final OperationObserver<CacheOperationOutcomes.PutIfAbsentOutcome>
private final OperationObserver<CacheOperationOutcomes.PutOutcome>
private final List<CacheExtension>
private final List<CacheLoader>
private volatile CacheWriter
private volatile RegisteredEventListeners
private final OperationObserver<CacheOperationOutcomes.RemoveAllOutcome>
private final OperationObserver<CacheOperationOutcomes.RemoveElementOutcome>
private final OperationObserver<CacheOperationOutcomes.RemoveOutcome>
private final OperationObserver<CacheOperationOutcomes.ReplaceOneArgOutcome>
private final OperationObserver<CacheOperationOutcomes.ReplaceTwoArgOutcome>
private final OperationObserver<CacheOperationOutcomes.SearchOutcome>
private StatisticsGateway
private volatile TransactionManagerLookup
private final boolean

Constructor Summary

AccessConstructor and Description
public
Cache(CacheConfiguration
the configuration that should be used to create the cache with
cacheConfiguration
)

2.0 and higher Constructor

The net.sf.ehcache.config.ConfigurationFactory and clients can create these.

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 net.sf.ehcache.config.ConfigurationFactory and clients can create these.

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 net.sf.ehcache.config.ConfigurationFactory and clients can create these.

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 net.sf.ehcache.config.ConfigurationFactory and clients can create these.

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 net.sf.ehcache.config.ConfigurationFactory and clients can create these.

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 net.sf.ehcache.config.ConfigurationFactory and clients can create these.

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 flush() is called on the cache
clearOnFlush
)

1.6.0 Constructor

The net.sf.ehcache.config.ConfigurationFactory and clients can create these.

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 flush() is called on the cache
clearOnFlush
,
boolean
whether 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 net.sf.ehcache.config.ConfigurationFactory and clients can create these.

pack-priv
Cache(CacheConfiguration config, Store compoundStore, RegisteredEventListeners listeners)

Test only

private
Cache(Cache original)

Constructor for cloning.

Method Summary

Modifier and TypeMethod and Description
private void
public void
acquireReadLockOnKey(Object
- The key that retrieves a value that you want to protect via locking
key
)

Implements net.sf.ehcache.Ehcache.acquireReadLockOnKey.

Acquires the proper read lock for a given cache key
public void
acquireWriteLockOnKey(Object
- The key that retrieves a value that you want to protect via locking
key
)

Implements net.sf.ehcache.Ehcache.acquireWriteLockOnKey.

Acquires the proper write lock for a given cache key
public synchronized void
private void
pack-priv Future<AtomicReference<Object>>

Returns:

a Future which can be used to monitor execution
asynchronousLoad
(final Object
the 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<V>

Returns:

a Future which can be used to monitor execution
asynchronousLoadAll
(final Collection<E> keys, final Object
the loader argument
argument
)

Creates a future to perform the load

pack-priv Future<V>

Returns:

a Future which can be used to monitor execution
asynchronousPut
(final Object
the 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
bootstrap()

Implements net.sf.ehcache.Ehcache.bootstrap.

Bootstrap command.
public final long

Returns:

the approximate size of the memory store in bytes
calculateInMemorySize
()

Implements net.sf.ehcache.Ehcache.calculateInMemorySize.

Deprecated
Gets the size of the memory store for this cache.
public final long

Returns:

the size of the off-heap store in bytes
calculateOffHeapSize
()

Implements net.sf.ehcache.Ehcache.calculateOffHeapSize.

Deprecated
Gets the size of the off-heap store for this cache.
public final long

Returns:

the size of the on-disk store in bytes
calculateOnDiskSize
()

Implements net.sf.ehcache.Ehcache.calculateOnDiskSize.

Deprecated
Gets the size of the on-disk store for this cache
private void
private void
checkCASOperationSupported(boolean doNotNotifyCacheReplicators)

private void
private static void
checkSearchAttributes(Set<Attribute<?>> requestedAttrs, Set<Attribute<T>> supportedAttrs, String src)

private void
private boolean
public final Cache

Returns:

an object of type Cache
clone
()

Overrides java.lang.Object.clone.

Implements net.sf.ehcache.Ehcache.clone.

Clones a cache.
public void
clusterCoherent(boolean
if the cluster is coherent
clusterCoherent
)

Implements net.sf.ehcache.store.StoreListener.clusterCoherent.

Inform of cluster coherence.
private static final BootstrapCacheLoader

Returns:

If there is none returns null.
createBootstrapCacheLoader
(CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration factoryConfiguration, ClassLoader loader)

Tries to load a BootstrapCacheLoader from the class specified.

private static CacheEventListener
createCacheEventListener(CacheConfiguration.CacheEventListenerFactoryConfiguration factoryConfiguration, ClassLoader loader)

Tries to load the class specified otherwise defaults to null.

private static CacheExtension
createCacheExtension(CacheConfiguration.CacheExtensionFactoryConfiguration factoryConfiguration, Ehcache cache, ClassLoader loader)

Tries to load the class specified otherwise defaults to null.

private static CacheLoader
createCacheLoader(CacheConfiguration.CacheLoaderFactoryConfiguration factoryConfiguration, Ehcache cache, ClassLoader loader)

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 store
createDiskStore
()

Creates a disk store when either:

  1. overflowToDisk is enabled
  2. diskPersistent is enabled
private String
createGuid()

Create globally unique ID for this cache.

public Query
createQuery()

Implements net.sf.ehcache.Ehcache.createQuery.

Create a new query builder for this cache
public void
disableDynamicFeatures()

Implements net.sf.ehcache.Ehcache.disableDynamicFeatures.

Disables dynamic configuration and disable/enable for this cache.
public synchronized void
dispose()

Implements net.sf.ehcache.Ehcache.dispose.

Starts an orderly shutdown of the Cache.
private void
private void
private void
public boolean

Returns:

true if this object is the same as the obj argument; false otherwise.
equals
(Object
the reference object with which to compare.
object
)

Overrides java.lang.Object.equals.

An equals method which follows the contract of Object#equals(Object)

An Cache is equal to another one if it implements Ehcache and has the same GUID.

public void
evictExpiredElements()

Implements net.sf.ehcache.Ehcache.evictExpiredElements.

Causes all elements stored in the Cache to be synchronously checked for expiry, and if expired, evicted.
pack-priv Results

Returns:

query results
executeQuery
(StoreQuery
query to execute
query
)

Execute the given query

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.sf.ehcache.Ehcache.flush.

Flushes all cache items from memory to the disk store, and from the DiskStore to disk.
public final Element

Returns:

the element, or null, if it does not exist.
get
(Serializable
a serializable value. Null keys are not stored so get(null) always returns null
key
)

Implements net.sf.ehcache.Ehcache.get.

Gets an element from the cache.
public final Element

Returns:

the element, or null, if it does not exist.
get
(Object
an Object value
key
)

Implements net.sf.ehcache.Ehcache.get.

Gets an element from the cache.
public Map<Object, Element>
getAll(Collection<?>
a collection of keys for which value is to be fetched
keys
)

Implements net.sf.ehcache.Ehcache.getAll.

Gets all the elements from the cache for the keys provided.
public Map<K, V>

Returns:

a Map populated from the Cache. If there are no elements, an empty Map is returned.
getAllWithLoader
(Collection<E>
a collection of keys to be returned/loaded
keys
,
Object
an argument to pass to the CacheLoader.
loaderArgument
)

Implements net.sf.ehcache.Ehcache.getAllWithLoader.

The getAll method will return, from the cache, a Map of the objects associated with the Collection of keys in argument "keys".
public BootstrapCacheLoader
getBootstrapCacheLoader()

Implements net.sf.ehcache.Ehcache.getBootstrapCacheLoader.

Accessor for the BootstrapCacheLoader associated with this cache.
private CacheCluster
public CacheConfiguration
getCacheConfiguration()

Implements net.sf.ehcache.Ehcache.getCacheConfiguration.

Gets the cache configuration this cache was created with.
public final RegisteredEventListeners

Returns:

the RegisteredEventListeners instance for this cache.
getCacheEventNotificationService
()

Implements net.sf.ehcache.Ehcache.getCacheEventNotificationService.

Use this to access the service in order to register and unregister listeners
public CacheExceptionHandler
getCacheExceptionHandler()

Implements net.sf.ehcache.Ehcache.getCacheExceptionHandler.

Gets the ExceptionHandler on this Cache, or null if there isn't one.
public final CacheManager

Returns:

the manager or null if there is none
getCacheManager
()

Implements net.sf.ehcache.Ehcache.getCacheManager.

Gets the CacheManager managing this cache.
public final int

Returns:

the number of elements in the disk store.
getDiskStoreSize
()

Implements net.sf.ehcache.Ehcache.getDiskStoreSize.

Deprecated
Returns the number of elements in the disk store.
pack-priv ExecutorService

Returns:

Gets the executor service. This is not publicly accessible.
getExecutorService
()

public final String

Returns:

the globally unique identifier for this cache instance. This is guaranteed to be unique.
getGuid
()

Implements net.sf.ehcache.Ehcache.getGuid.

The GUID for this cache instance can be used to determine whether two cache instance references are pointing to the same cache.
public Object
public final List<E>

Returns:

a list of Object keys
getKeys
()

Implements net.sf.ehcache.Ehcache.getKeys.

Returns a list of all element keys in the cache, whether or not they are expired.
public final List<E>

Returns:

a list of Object keys
getKeysNoDuplicateCheck
()

Implements net.sf.ehcache.Ehcache.getKeysNoDuplicateCheck.

Returns a list of all elements in the cache, whether or not they are expired.
public final List<E>

Returns:

a list of Object keys
getKeysWithExpiryCheck
()

Implements net.sf.ehcache.Ehcache.getKeysWithExpiryCheck.

Returns a list of all element keys in the cache.
protected Sync

Returns:

the lock object for the passed in key
getLockForKey
(final Object
the 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.
getMemoryStoreEvictionPolicy
()

public final long

Returns:

the number of elements in the memory store
getMemoryStoreSize
()

Implements net.sf.ehcache.Ehcache.getMemoryStoreSize.

Deprecated
Returns the number of elements in the memory store.
public final String
getName()

Implements net.sf.ehcache.Ehcache.getName.

Gets the cache name.
public long

Returns:

the number of elements in the off-heap store
getOffHeapStoreSize
()

Implements net.sf.ehcache.Ehcache.getOffHeapStoreSize.

Deprecated
Returns the number of elements in the off-heap store.
public final Element

Returns:

the element, or null, if it does not exist.
getQuiet
(Serializable
a serializable value
key
)

Implements net.sf.ehcache.Ehcache.getQuiet.

Gets an element from the cache, without updating Element statistics.
public final Element

Returns:

the element, or null, if it does not exist.
getQuiet
(Object
a serializable value
key
)

Implements net.sf.ehcache.Ehcache.getQuiet.

Gets an element from the cache, without updating Element statistics.
public List<CacheExtension>

Returns:

the cache extensions as a live list
getRegisteredCacheExtensions
()

Implements net.sf.ehcache.Ehcache.getRegisteredCacheExtensions.

public List<CacheLoader>

Returns:

the cache loaders as a live list
getRegisteredCacheLoaders
()

Implements net.sf.ehcache.Ehcache.getRegisteredCacheLoaders.

public CacheWriter
getRegisteredCacheWriter()

Implements net.sf.ehcache.Ehcache.getRegisteredCacheWriter.

Retrieves the CacheWriter that was registered for this cache.
public <T> Attribute<T>
getSearchAttribute(String
the name of the attribute to retrieve
attributeName
)

Implements net.sf.ehcache.Ehcache.getSearchAttribute.

Retrieve the given named search attribute
public Set<Attribute<T>>

Returns:

set of all search attributes in effect at the time of calling this method
getSearchAttributes
()

Implements net.sf.ehcache.Ehcache.getSearchAttributes.

public final int

Returns:

The size value
getSize
()

Implements net.sf.ehcache.Ehcache.getSize.

Gets the size of the cache.
public StatisticsGateway
getStatistics()

Implements net.sf.ehcache.Ehcache.getStatistics.

Gets an immutable Statistics object representing the Cache statistics at the time.
public final Status

Returns:

The status value from the Status enum class
getStatus
()

Implements net.sf.ehcache.Ehcache.getStatus.

Gets the status attribute of the Cache.
pack-priv final Store

Returns:

the Store referenced by this cache
getStore
()

Gets the internal Store.

public final Object

Returns:

the store MBean
getStoreMBean
()

Get the optional store management bean for this cache.

public TransactionManagerLookup
getTransactionManagerLookup()

Get the TransactionManagerLookup implementation used to lookup the TransactionManager.

public Element

Returns:

an element if it existed or could be loaded, otherwise null
getWithLoader
(Object
key 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.sf.ehcache.Ehcache.getWithLoader.

This method will return, from the cache, the Element associated with the argument "key".
public CacheWriterManager
getWriterManager()

Implements net.sf.ehcache.Ehcache.getWriterManager.

Obtain the writer manager that's used by this cache instance.
private void
private Store
public boolean
hasAbortedSizeOf()

Implements net.sf.ehcache.Ehcache.hasAbortedSizeOf.

Check if the cache may contain elements which the SizeOf engine could not fully size.
public int

Returns:

a hash code value for this object.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public void
initialise()

Implements net.sf.ehcache.Ehcache.initialise.

Newly created caches do not have a net.sf.ehcache.store.Store.
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.sf.ehcache.Ehcache.isClusterBulkLoadEnabled.

Returns true if at least one node in the cluster is in bulk-load mode.
public boolean
isClusterCoherent()

Implements net.sf.ehcache.Ehcache.isClusterCoherent.

Deprecated use isClusterBulkLoadEnabled() instead
Returns true if the cache is in coherent mode cluster-wide.
public boolean

Returns:

true if the cache is disabled.
isDisabled
()

Implements net.sf.ehcache.Ehcache.isDisabled.

Whether this cache is disabled.
protected boolean

Returns:

true if the cache either overflows to disk or uses a local-classic persistence strategy.
isDiskStore
()

Whether this cache uses a disk store

public final boolean

Returns:

true if an element matching the key is found in memory
isElementInMemory
(Serializable
the key of the element to remove
key
)

Implements net.sf.ehcache.Ehcache.isElementInMemory.

Whether an Element is stored in the cache in Memory, indicating a very low cost of retrieval.
public final boolean

Returns:

true if an element matching the key is found in memory
isElementInMemory
(Object
the key of the element to remove
key
)

Implements net.sf.ehcache.Ehcache.isElementInMemory.

Whether an Element is stored in the cache in Memory, indicating a very low cost of retrieval.
public final boolean

Returns:

true if an element matching the key is found in off-heap
isElementOffHeap
(Object
key 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 diskStore
isElementOnDisk
(Serializable
key to look for
key
)

Implements net.sf.ehcache.Ehcache.isElementOnDisk.

Whether an Element is stored in the cache on Disk, indicating a higher cost of retrieval.
public final boolean

Returns:

true if an element matching the key is found in the diskStore
isElementOnDisk
(Object
key to look for
key
)

Implements net.sf.ehcache.Ehcache.isElementOnDisk.

Whether an Element is stored in the cache on Disk, indicating a higher cost of retrieval.
public final boolean

Returns:

true if it has expired
isExpired
(Element
the element to check
element
)

Implements net.sf.ehcache.Ehcache.isExpired.

Checks whether this cache element has expired.
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.
isKeyInCache
(Object
the key to check.
key
)

Implements net.sf.ehcache.Ehcache.isKeyInCache.

An inexpensive check to see if the key exists in the cache.
public boolean
isNodeBulkLoadEnabled()

Implements net.sf.ehcache.Ehcache.isNodeBulkLoadEnabled.

Returns true if the current node is in bulk-load mode.
public boolean
isNodeCoherent()

Implements net.sf.ehcache.Ehcache.isNodeCoherent.

Deprecated use isNodeBulkLoadEnabled() instead
Returns true if the cache is in coherent mode for the current node.
public boolean
isReadLockedByCurrentThread(Object
the key
key
)

Implements net.sf.ehcache.Ehcache.isReadLockedByCurrentThread.

Returns true if a read lock for the key is held by the current thread

Only Terracotta clustered cache instances currently support querying a thread's read lock hold status.

public boolean
isSearchable()

Implements net.sf.ehcache.Ehcache.isSearchable.

Is this cache searchable?
public boolean

Returns:

true when the cache is clustered by Terracotta; or false otherwise
isTerracottaClustered
()

Indicates 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.
isValueInCache
(Object
to check for
value
)

Implements net.sf.ehcache.Ehcache.isValueInCache.

An extremely expensive check to see if the value exists in the cache.
public boolean
isWriteLockedByCurrentThread(Object
the key
key
)

Implements net.sf.ehcache.Ehcache.isWriteLockedByCurrentThread.

Returns true if a write lock for the key is held by the current thread
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.sf.ehcache.Ehcache.load.

The load method provides a means to "pre-load" the cache.
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

The Ehcache native API provides similar functionality to loaders using the decorator net.sf.ehcache.constructs.blocking.SelfPopulatingCache

argument
)

Implements net.sf.ehcache.Ehcache.loadAll.

The loadAll method provides a means to "pre load" objects into the cache.
private Object

Returns:

null if not present in the underlying SoR or if no loader available, otherwise the loaded object
loadValueUsingLoader
(final Object
the 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<K, V>

Returns:

A map of loaded elements
loadWithRegisteredLoaders
(Object
the loader argument
argument
,
Set<Object>
the Set of keys that are already in the Cache
nonLoadedKeys
)

Does the asynchronous loading.

private void
private TerracottaStore
private AbstractTransactionStore
makeTransactional(final Store store)

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 null or the key is null, it is ignored as a NOOP.
element
)

Implements net.sf.ehcache.Ehcache.put.

Put an element in the cache.
public final void
put(Element
A cache Element. If Serializable it can fully participate in replication and the DiskStore. If it is null or the key is null, it is ignored as a NOOP.
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.sf.ehcache.Ehcache.put.

Put an element in the cache.
public void
putAll(Collection<Element>
the collection of elements to be put in the cache.
elements
)

Implements net.sf.ehcache.Ehcache.putAll.

Puts a collection of elements in to the cache.
private void
putAll(Collection<Element> elements, boolean doNotNotifyCacheReplicators)

private void
putAllInternal(Collection<Element> elements, boolean doNotNotifyCacheReplicators)

public Element
putIfAbsent(Element
element to be added
element
)

Implements net.sf.ehcache.Ehcache.putIfAbsent.

Put an element in the cache if no element is currently mapped to the elements key.
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.sf.ehcache.Ehcache.putIfAbsent.

Put an element in the cache if no element is currently mapped to the elements key.
private void
putInternal(Element element, boolean doNotNotifyCacheReplicators, boolean useCacheWriter)

public final void
putQuiet(Element
A cache Element. If Serializable it can fully participate in replication and the DiskStore. If it is null or the key is null, it is ignored as a NOOP.
element
)

Implements net.sf.ehcache.Ehcache.putQuiet.

Put an element in the cache, without updating statistics, or updating listeners.
public void
putWithWriter(Element
An object. If Serializable it can fully participate in replication and the DiskStore.
element
)

Implements net.sf.ehcache.Ehcache.putWithWriter.

Put an element in the cache writing through a CacheWriter.
public void
recalculateSize(Object
the key
key
)

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

Recalculate the size of the element mapped to the key
public void
registerCacheExtension(CacheExtension
the cache extension
cacheExtension
)

Implements net.sf.ehcache.Ehcache.registerCacheExtension.

Register a 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.sf.ehcache.Ehcache.registerCacheLoader.

Register a 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.sf.ehcache.Ehcache.registerCacheWriter.

Register the CacheWriter for this cache.
public void
registerDynamicAttributesExtractor(DynamicAttributesExtractor
the dynamic attribute extractor
extractor
)

Implements net.sf.ehcache.Ehcache.registerDynamicAttributesExtractor.

Allows user to register a dynamic attribute extractor with a searchable cache that is dynamically indexable, as indicated by its configuration.
private void
public void
releaseReadLockOnKey(Object
- The key that retrieves a value that you want to protect via locking
key
)

Implements net.sf.ehcache.Ehcache.releaseReadLockOnKey.

Release a held read lock for the passed in key
public void
releaseWriteLockOnKey(Object
- The key that retrieves a value that you want to protect via locking
key
)

Implements net.sf.ehcache.Ehcache.releaseWriteLockOnKey.

Release a held write lock for the passed in key
public final boolean

Returns:

true if the element was removed, false if it was not found in the cache
remove
(Serializable
the element key to operate on
key
)

Implements net.sf.ehcache.Ehcache.remove.

Removes an Element from the Cache.
public final boolean

Returns:

true if the element was removed, false if it was not found in the cache
remove
(Object
the element key to operate on
key
)

Implements net.sf.ehcache.Ehcache.remove.

Removes an Element from the Cache.
public final boolean

Returns:

true if the element was removed, false if it was not found in the cache
remove
(Serializable
the 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.sf.ehcache.Ehcache.remove.

Removes an Element from the Cache.
public final boolean

Returns:

true if the element was removed, false if it was not found in the cache
remove
(Object
the 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.sf.ehcache.Ehcache.remove.

Removes an Element from the Cache.
public void
removeAll(final Collection<?>
a collection of keys to operate on
keys
)

Implements net.sf.ehcache.Ehcache.removeAll.

Removes given set of net.sf.ehcache.Element 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.sf.ehcache.Ehcache.removeAll.

Removes all cached items.
public void
removeAll()

Implements net.sf.ehcache.Ehcache.removeAll.

Removes all cached items.
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.sf.ehcache.Ehcache.removeAll.

Removes all cached items.
private void

Returns:

true if the element was removed, false if it was not found in the cache
removeAllInternal
(final Collection<?>
a 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 Elements from the Cache after an attempt to get it determined that it should be expired.

public final Element

Returns:

element the removed element associated with the key, null if no mapping exists
removeAndReturnElement
(Object
the element key to operate on
key
)

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

Removes an Element from the Cache and returns it.
public boolean
removeElement(Element
Element to be removed
element
)

Implements net.sf.ehcache.Ehcache.removeElement.

Remove the Element mapped to the key for the supplied element if the value of the supplied Element compares equal to the value of the cached Element.
private Element

Returns:

element if the element was removed, null if it was not found in the cache
removeInternal
(Object
the 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 Element from the Cache after an attempt to get it determined that it should be expired.

public synchronized void
public final boolean

Returns:

true if the element was removed, false if it was not found in the cache
removeQuiet
(Serializable
the element key to operate on
key
)

Implements net.sf.ehcache.Ehcache.removeQuiet.

Removes an 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 cache
removeQuiet
(Object
the element key to operate on
key
)

Implements net.sf.ehcache.Ehcache.removeQuiet.

Removes an Element from the Cache, without notifying listeners.
public boolean
removeWithWriter(Object
of the element to remove
key
)

Implements net.sf.ehcache.Ehcache.removeWithWriter.

Removes an net.sf.ehcache.Element 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.sf.ehcache.Ehcache.replace.

Replace the cached element only if the current Element is equal to the supplied old Element.
public Element
replace(Element
Element to be cached
element
)

Implements net.sf.ehcache.Ehcache.replace.

Replace the cached element only if an Element is currently cached for this key
public void
setBootstrapCacheLoader(BootstrapCacheLoader
the loader to be used
bootstrapCacheLoader
)

Implements net.sf.ehcache.Ehcache.setBootstrapCacheLoader.

Sets the bootstrap cache loader.
public void
setCacheExceptionHandler(CacheExceptionHandler
the cache exception handler
cacheExceptionHandler
)

Implements net.sf.ehcache.Ehcache.setCacheExceptionHandler.

Sets an ExceptionHandler on the Cache.
public void
setCacheManager(CacheManager
the CacheManager for this cache to use.
cacheManager
)

Implements net.sf.ehcache.Ehcache.setCacheManager.

For use by CacheManager.
public void
setDisabled(boolean
true if you wish to disable, false to enable
disabled
)

Implements net.sf.ehcache.Ehcache.setDisabled.

Disables or enables this cache.
public void
setMemoryStoreEvictionPolicy(Policy
the new policy
policy
)

Sets the eviction policy strategy.

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.sf.ehcache.Ehcache.setName.

Sets the cache name which will name.
public void
setNodeBulkLoadEnabled(boolean
true enables bulk-load, false disables it if not already disabled
enabledBulkLoad
)

Implements net.sf.ehcache.Ehcache.setNodeBulkLoadEnabled.

Enable/disable bulk-load mode in this node for this cache.
public void
setNodeCoherent(boolean
true transitions to coherent mode, false to incoherent mode
coherent
)

Implements net.sf.ehcache.Ehcache.setNodeCoherent.

Deprecated use setNodeBulkLoadEnabled(boolean) instead
Sets the cache in coherent or incoherent mode depending on the parameter on this node.
public void
setTransactionManagerLookup(TransactionManagerLookup lookup)

Implements net.sf.ehcache.Ehcache.setTransactionManagerLookup.

Sets the TransactionManagerLookup that needs to be used for this cache to lookup the TransactionManager This needs to be set before Cache#initialise() is called
private boolean
public String
toString()

Overrides java.lang.Object.toString.

Implements net.sf.ehcache.Ehcache.toString.

Returns a String representation of Cache.
public boolean

Returns:

whether the lock was awarded
tryReadLockOnKey
(Object
- 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.sf.ehcache.Ehcache.tryReadLockOnKey.

Try to get a read lock on a given key.
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
tryWriteLockOnKey
(Object
- 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.sf.ehcache.Ehcache.tryWriteLockOnKey.

Try to get a write lock on a given key.
public void
unregisterCacheExtension(CacheExtension
the cache extension
cacheExtension
)

Implements net.sf.ehcache.Ehcache.unregisterCacheExtension.

Unregister a CacheExtension with the cache.
public void
unregisterCacheLoader(CacheLoader
A Cache Loader to unregister
cacheLoader
)

Implements net.sf.ehcache.Ehcache.unregisterCacheLoader.

Unregister a CacheLoader with the cache.
public void
private void
public void
waitUntilClusterBulkLoadComplete()

Implements net.sf.ehcache.Ehcache.waitUntilClusterBulkLoadComplete.

This method waits until all the connected nodes have disabled bulk-load.
public void
waitUntilClusterCoherent()

Implements net.sf.ehcache.Ehcache.waitUntilClusterCoherent.

Deprecated use waitUntilClusterBulkLoadComplete() instead
This method waits until the cache is in coherent mode in all the connected nodes.
Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait