public class JtaLocalTransactionStore extends AbstractTransactionStore
Modifier and Type | Class and Description |
---|---|
private static class |
JtaLocalTransactionStore.JtaLocalEhcacheSynchronization
A Synchronization used to terminate the local transaction and clean it up
|
private static class |
JtaLocalTransactionStore.JtaLocalEhcacheXAResource
A XAResource implementation used to terminate the local transaction and clean it up.
|
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ALTERNATIVE_TERMINATION_MODE_SYS_PROPERTY_NAME |
private static java.util.concurrent.atomic.AtomicBoolean |
ATOMIKOS_WARNING_ISSUED |
private static VicariousThreadLocal<javax.transaction.Transaction> |
BOUND_JTA_TRANSACTIONS |
private Ehcache |
cache |
private static org.slf4j.Logger |
LOG |
private TransactionController |
transactionController |
private javax.transaction.TransactionManager |
transactionManager |
private TransactionManagerLookup |
transactionManagerLookup |
copyStrategy, underlyingStore
attributeExtractors
CLUSTER_COHERENT, NODE_COHERENT
Constructor and Description |
---|
JtaLocalTransactionStore(LocalTransactionStore underlyingStore,
TransactionManagerLookup transactionManagerLookup,
TransactionController transactionController)
Create a new JtaLocalTransactionStore instance
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(java.lang.Object key)
A check to see if a key is in the Store.
|
Element |
get(java.lang.Object key)
Gets an item from the cache.
|
java.util.List |
getKeys()
Gets an Array of the keys for all elements in the disk store.
|
Element |
getQuiet(java.lang.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 element)
Puts an item into the store.
|
void |
putAll(java.util.Collection<Element> elements)
Puts a collection of elements into the store.
|
Element |
putIfAbsent(Element element)
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
|
private void |
registerInJtaContext() |
Element |
remove(java.lang.Object key)
Removes an item from the cache.
|
void |
removeAll()
Remove all of the elements from the store.
|
void |
removeAll(java.util.Collection<?> keys)
Removes a collection of elements from the cache.
|
Element |
removeElement(Element element,
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(java.lang.Object key,
CacheWriterManager writerManager)
Removes an item from the store and the cache writer manager in an atomic operation.
|
Element |
replace(Element element)
Replace the cached element only if an Element is currently cached for this key
|
boolean |
replace(Element old,
Element element,
ElementValueComparator comparator)
Replace the cached element only if the value of the current Element is equal to the value of the
supplied old Element.
|
private void |
setRollbackOnly() |
bufferFull, containsKeyInMemory, containsKeyOffHeap, containsKeyOnDisk, copyElementForRead, copyElementForWrite, dispose, executeQuery, expireElements, flush, getInMemoryEvictionPolicy, getInMemorySize, getInMemorySizeInBytes, getInternalContext, getLocalKeys, getMBean, getOffHeapSize, getOffHeapSizeInBytes, getOnDiskSize, getOnDiskSizeInBytes, getSearchAttribute, getStatus, getTransactionalMode, hasAbortedSizeOf, isCacheCoherent, isClusterCoherent, isNodeCoherent, isPinned, setAttributeExtractors, setInMemoryEvictionPolicy, setNodeCoherent, setPinned, unlockedGet, unlockedGetQuiet, unpinAll, unsafeGet, unsafeGetQuiet, waitUntilClusterCoherent
addStoreListener, getAll, getAllQuiet, getEventListenerList, recalculateSize, removeStoreListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addStoreListener, getAll, getAllQuiet, recalculateSize, removeStoreListener
private static final org.slf4j.Logger LOG
private static final java.lang.String ALTERNATIVE_TERMINATION_MODE_SYS_PROPERTY_NAME
private static final java.util.concurrent.atomic.AtomicBoolean ATOMIKOS_WARNING_ISSUED
private static final VicariousThreadLocal<javax.transaction.Transaction> BOUND_JTA_TRANSACTIONS
private final TransactionManagerLookup transactionManagerLookup
private final TransactionController transactionController
private final javax.transaction.TransactionManager transactionManager
private final Ehcache cache
public JtaLocalTransactionStore(LocalTransactionStore underlyingStore, TransactionManagerLookup transactionManagerLookup, TransactionController transactionController)
underlyingStore
- the underlying LocalTransactionStoretransactionManagerLookup
- the TransactionManagerLookuptransactionController
- the TransactionControllerprivate void registerInJtaContext()
private void setRollbackOnly()
public boolean put(Element element) throws CacheException
CacheException
public void putAll(java.util.Collection<Element> elements) throws CacheException
putAll
in interface Store
putAll
in class AbstractStore
elements
- Collection of elements to be put in the storeCacheException
public boolean putWithWriter(Element element, CacheWriterManager writerManager) throws CacheException
CacheException
public Element get(java.lang.Object key)
public Element getQuiet(java.lang.Object key)
Element
from the Store, without updating statisticspublic java.util.List getKeys()
Serializable
keyspublic Element remove(java.lang.Object key)
public void removeAll(java.util.Collection<?> keys)
removeAll
in interface Store
removeAll
in class AbstractStore
public Element removeWithWriter(java.lang.Object key, CacheWriterManager writerManager) throws CacheException
CacheException
public void removeAll() throws CacheException
CacheEventListener
s they are notified of the expiry or removal
of the Element
as each is removed.CacheException
public Element putIfAbsent(Element element) throws java.lang.NullPointerException
element
- element to be addedjava.lang.NullPointerException
- if the element is null, or has a null keypublic Element removeElement(Element element, ElementValueComparator comparator) throws java.lang.NullPointerException
element
- Element to be removedcomparator
- ElementValueComparator to use to compare elementsjava.lang.NullPointerException
- if the element is null, or has a null keypublic boolean replace(Element old, Element element, ElementValueComparator comparator) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
old
- Element to be test againstelement
- Element to be cachedcomparator
- ElementValueComparator to use to compare elementsjava.lang.NullPointerException
- if the either Element is null or has a null keyjava.lang.IllegalArgumentException
- if the two Element keys are non-null but not equalpublic Element replace(Element element) throws java.lang.NullPointerException
element
- Element to be cachedjava.lang.NullPointerException
- if the Element is null or has a null keypublic int getSize()
public int getTerracottaClusteredSize()
public boolean containsKey(java.lang.Object key)
key
- The Element key