|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.store.AbstractStore net.sf.ehcache.transaction.AbstractTransactionStore net.sf.ehcache.transaction.local.LocalTransactionStore
public class LocalTransactionStore
A Store implementation with support for local transactions
Field Summary |
---|
Fields inherited from class net.sf.ehcache.transaction.AbstractTransactionStore |
---|
copyStrategy, underlyingStore |
Fields inherited from class net.sf.ehcache.store.AbstractStore |
---|
attributeExtractors |
Fields inherited from interface net.sf.ehcache.store.Store |
---|
CLUSTER_COHERENT, NODE_COHERENT |
Constructor Summary | |
---|---|
LocalTransactionStore(TransactionController transactionController,
TransactionIDFactory transactionIdFactory,
SoftLockManager softLockManager,
Ehcache cache,
Store store,
ReadWriteCopyStrategy<Element> copyStrategy)
Create a new LocalTransactionStore instance |
Method Summary | |
---|---|
boolean |
containsKey(Object key)
A check to see if a key is in the Store. |
void |
dispose()
Prepares for shutdown. |
Element |
get(Object key)
Gets an item from the cache. |
List |
getKeys()
Gets an Array of the keys for all elements in the disk store. |
Element |
getQuiet(Object key)
Gets an Element from the Store, without updating statistics |
int |
getSize()
Returns the current local store size |
int |
getTerracottaClusteredSize()
Returns the current Terracotta clustered store size |
boolean |
put(Element e)
Puts an item into the store. |
Element |
putIfAbsent(Element e)
Put an element in the store if no element is currently mapped to the elements key. |
boolean |
putWithWriter(Element element,
CacheWriterManager writerManager)
Puts an item into the store and the cache writer manager in an atomic operation |
Set<TransactionID> |
recover()
Recover and resolve all known soft locks |
Element |
remove(Object key)
Removes an item from the cache. |
void |
removeAll()
Remove all of the elements from the store. |
Element |
removeElement(Element e,
ElementValueComparator comparator)
Remove the Element mapped to the key for the supplied element if the value of the supplied Element is equal to the value of the cached Element. |
Element |
removeWithWriter(Object key,
CacheWriterManager writerManager)
Removes an item from the store and the cache writer manager in an atomic operation. |
Element |
replace(Element e)
Replace the cached element only if an Element is currently cached for this key |
boolean |
replace(Element oe,
Element ne,
ElementValueComparator comparator)
Replace the cached element only if the value of the current Element is equal to the value of the supplied old Element. |
void |
setAttributeExtractors(Map<String,AttributeExtractor> extractors)
Inform this store of the configured attribute extractors. |
Methods inherited from class net.sf.ehcache.store.AbstractStore |
---|
addStoreListener, getAll, getAllQuiet, getEventListenerList, putAll, recalculateSize, removeAll, removeStoreListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.ehcache.store.Store |
---|
addStoreListener, getAll, getAllQuiet, putAll, recalculateSize, removeAll, removeStoreListener |
Constructor Detail |
---|
public LocalTransactionStore(TransactionController transactionController, TransactionIDFactory transactionIdFactory, SoftLockManager softLockManager, Ehcache cache, Store store, ReadWriteCopyStrategy<Element> copyStrategy)
transactionController
- the TransactionControllersoftLockManager
- the SoftLockManagercache
- the cachestore
- the underlying storecopyStrategy
- the configured CopyStrategyMethod Detail |
---|
public void dispose()
AbstractTransactionStore
dispose
in interface Store
dispose
in class AbstractTransactionStore
public Set<TransactionID> recover()
public boolean put(Element e) throws CacheException
CacheException
public Element getQuiet(Object key)
Element
from the Store, without updating statistics
public Element get(Object key)
public Element remove(Object key)
public List getKeys()
Serializable
keyspublic int getSize()
public int getTerracottaClusteredSize()
public boolean containsKey(Object key)
key
- The Element key
public void removeAll() throws CacheException
CacheEventListener
s they are notified of the expiry or removal
of the Element
as each is removed.
CacheException
public boolean putWithWriter(Element element, CacheWriterManager writerManager) throws CacheException
CacheException
public Element removeWithWriter(Object key, CacheWriterManager writerManager) throws CacheException
CacheException
public Element putIfAbsent(Element e) throws NullPointerException
e
- element to be added
NullPointerException
- if the element is null, or has a null keypublic Element removeElement(Element e, ElementValueComparator comparator) throws NullPointerException
e
- Element to be removedcomparator
- ElementValueComparator to use to compare elements
NullPointerException
- if the element is null, or has a null keypublic boolean replace(Element oe, Element ne, ElementValueComparator comparator) throws NullPointerException, IllegalArgumentException
oe
- Element to be test againstne
- Element to be cachedcomparator
- ElementValueComparator to use to compare elements
NullPointerException
- if the either Element is null or has a null key
IllegalArgumentException
- if the two Element keys are non-null but not equalpublic Element replace(Element e) throws NullPointerException
e
- Element to be cached
NullPointerException
- if the Element is null or has a null keypublic void setAttributeExtractors(Map<String,AttributeExtractor> extractors)
setAttributeExtractors
in interface Store
setAttributeExtractors
in class AbstractTransactionStore
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |