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

public Class StronglyConsistentCacheAccessor

extends EhcacheDecoratorAdapter
Class Inheritance
Imports
net.sf.ehcache.CacheException, .Ehcache, .Element, net.sf.ehcache.config.TerracottaConfiguration, net.sf.ehcache.constructs.EhcacheDecoratorAdapter, net.sf.ehcache.loader.CacheLoader, net.sf.ehcache.store.ElementValueComparator, java.io.Serializable, java.util.Collection, .HashMap, .Map

StronglyConsistentCacheAccessor is a decorator that accepts distributed caches configured with eventual consistency.

The accessor will then lock for all operations:

Author
Louis Jacomet

Field Summary

Modifier and TypeField and Description
private final ElementValueComparator
Inherited from net.sf.ehcache.constructs.EhcacheDecoratorAdapter:
underlyingCache

Constructor Summary

AccessConstructor and Description
public
StronglyConsistentCacheAccessor(Ehcache
a clustered cache configured with eventual consistency
underlyingCache
)

Constructor accepting the cache to be decorated.

Method Summary

Modifier and TypeMethod and Description
public Element
get(Object
an Object value
key
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.get.

Implements net.sf.ehcache.Ehcache.get.

Gets an element from the cache.
public Element
get(Serializable
a serializable value
key
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.get.

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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.getAll.

Implements net.sf.ehcache.Ehcache.getAll.

Gets all the elements from the cache for the keys provided.
public Map<K, V>
getAllWithLoader(Collection<E>
a collection of keys to be returned/loaded
keys
,
Object
an argument to pass to the CacheLoader.
loaderArgument
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.getAllWithLoader.

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 Element
getQuiet(Object
a serializable value
key
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.getQuiet.

Implements net.sf.ehcache.Ehcache.getQuiet.

Gets an element from the cache, without updating Element statistics.
public Element
getQuiet(Serializable
a serializable value
key
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.getQuiet.

Implements net.sf.ehcache.Ehcache.getQuiet.

Gets an element from the cache, without updating Element statistics.
public Element
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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.getWithLoader.

Implements net.sf.ehcache.Ehcache.getWithLoader.

This method will return, from the cache, the object associated with the argument "key".
public void
put(Element
An object. If Serializable it can fully participate in replication and the DiskStore.
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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.put.

Implements net.sf.ehcache.Ehcache.put.

Put an element in the cache.
public void
put(Element
An object. If Serializable it can fully participate in replication and the DiskStore.
element
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.put.

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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.putAll.

Implements net.sf.ehcache.Ehcache.putAll.

Puts a collection of elements in to the cache.
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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.putIfAbsent.

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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.putIfAbsent.

Implements net.sf.ehcache.Ehcache.putIfAbsent.

Put an element in the cache if no element is currently mapped to the elements key.
public void
putQuiet(Element
An object. If Serializable it can fully participate in replication and the DiskStore.
element
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.putQuiet.

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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.putWithWriter.

Implements net.sf.ehcache.Ehcache.putWithWriter.

Put an element in the cache writing through a CacheWriter.
public boolean
remove(Object
of the element to remove
key
,
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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.remove.

Implements net.sf.ehcache.Ehcache.remove.

Removes an net.sf.ehcache.Element from the Cache.
public boolean
remove(Object
the key of the element to remove
key
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.remove.

Implements net.sf.ehcache.Ehcache.remove.

Removes an net.sf.ehcache.Element from the Cache.
public boolean
remove(Serializable
the key of the element to remove
key
,
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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.remove.

Implements net.sf.ehcache.Ehcache.remove.

Removes an net.sf.ehcache.Element from the Cache.
public boolean
remove(Serializable
the key of the element to remove
key
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.remove.

Implements net.sf.ehcache.Ehcache.remove.

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

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.removeAll.

Implements net.sf.ehcache.Ehcache.removeAll.

Removes given set of net.sf.ehcache.Element from the Cache.
public void
removeAll(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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.removeAll.

Implements net.sf.ehcache.Ehcache.removeAll.

Removes all cached items.
public Element
removeAndReturnElement(Object
the key of the element to operate on
key
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.removeAndReturnElement.

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

Removes and returns the element associated with the key
public boolean
removeElement(Element
Element to be removed
element
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.removeElement.

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.
public boolean
removeQuiet(Object
of the element to remove
key
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.removeQuiet.

Implements net.sf.ehcache.Ehcache.removeQuiet.

Removes an net.sf.ehcache.Element from the Cache, without notifying listeners.
public boolean
removeQuiet(Serializable
of the element to remove
key
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.removeQuiet.

Implements net.sf.ehcache.Ehcache.removeQuiet.

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

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.removeWithWriter.

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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.replace.

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
)

Overrides net.sf.ehcache.constructs.EhcacheDecoratorAdapter.replace.

Implements net.sf.ehcache.Ehcache.replace.

Replace the cached element only if an Element is currently cached for this key
Inherited from net.sf.ehcache.constructs.EhcacheDecoratorAdapter:
acquireReadLockOnKeyacquireWriteLockOnKeyaddPropertyChangeListenerbootstrapcalculateInMemorySizecalculateOffHeapSizecalculateOnDiskSizeclonecreateQuerydisableDynamicFeaturesdisposeevictExpiredElementsflushgetBootstrapCacheLoadergetCacheConfigurationgetCacheEventNotificationServicegetCacheExceptionHandlergetCacheManagergetDiskStoreSizegetGuidgetInternalContextgetKeysgetKeysNoDuplicateCheckgetKeysWithExpiryCheckgetMemoryStoreSizegetNamegetOffHeapStoreSizegetRegisteredCacheExtensionsgetRegisteredCacheLoadersgetRegisteredCacheWritergetSearchAttributegetSearchAttributesgetSizegetStatisticsgetStatusgetWriterManagerhasAbortedSizeOfinitialiseisClusterBulkLoadEnabledisClusterCoherentisDisabledisElementInMemoryisElementInMemoryisElementOnDiskisElementOnDiskisExpiredisKeyInCacheisNodeBulkLoadEnabledisNodeCoherentisReadLockedByCurrentThreadisSearchableisValueInCacheisWriteLockedByCurrentThreadloadloadAllrecalculateSizeregisterCacheExtensionregisterCacheLoaderregisterCacheWriterregisterDynamicAttributesExtractorreleaseReadLockOnKeyreleaseWriteLockOnKeyremoveAllremoveAllremovePropertyChangeListenersetBootstrapCacheLoadersetCacheExceptionHandlersetCacheManagersetDisabledsetNamesetNodeBulkLoadEnabledsetNodeCoherentsetTransactionManagerLookuptoStringtryReadLockOnKeytryWriteLockOnKeyunregisterCacheExtensionunregisterCacheLoaderunregisterCacheWriterwaitUntilClusterBulkLoadCompletewaitUntilClusterCoherent