public abstract class AbstractTxInvocationContext<T extends AbstractCacheTransaction> extends AbstractInvocationContext implements TxInvocationContext<T>
TxInvocationContext.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTxInvocationContext(T cacheTransaction,
Address origin) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAffectedKey(Object key) |
void |
addAllAffectedKeys(Collection<?> keys)
Registers a new participant with the transaction.
|
void |
addLockedKey(Object key)
Tracks the given key as locked by this invocation context.
|
void |
clearLockedKeys() |
Set<Object> |
getAffectedKeys()
Returns the set of keys that are affected by this transaction.
|
T |
getCacheTransaction() |
GlobalTransaction |
getGlobalTransaction()
Returns the id of the transaction associated with the current call.
|
Set<Object> |
getLockedKeys()
Returns the set of keys that are locked for writing.
|
Object |
getLockOwner()
Returns the in behalf of which locks will be acquired.
|
Map<Object,CacheEntry> |
getLookedUpEntries()
Retrieves a map of entries looked up within the current scope.
|
List<WriteCommand> |
getModifications()
Returns the modifications performed in the scope of the current transaction.
|
boolean |
hasModifications()
Checks if there are modifications performed within the tx's scope.
|
boolean |
isInTxScope()
Returns true if this call is performed in the context of an transaction, false otherwise.
|
CacheEntry |
lookupEntry(Object key)
Retrieves an entry from the collection of looked up entries in the current scope.
|
void |
putLookedUpEntry(Object key,
CacheEntry e)
Puts an entry in the registry of looked up entries in the current scope.
|
void |
removeLookedUpEntry(Object key) |
void |
setLockOwner(Object lockOwner)
Sets the object to be used by lock owner.
|
clone, getOrigin, hasLockedKey, isEntryRemovedInContext, isOriginLocalequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTransaction, isImplicitTransaction, isTransactionValidaddLockedKeys, clone, getOrigin, hasLockedKey, isEntryRemovedInContext, isOriginLocalforEachEntry, forEachValue, lookedUpEntriesCount, removeLookedUpEntriespublic Object getLockOwner()
InvocationContextgetLockOwner in interface InvocationContextpublic void setLockOwner(Object lockOwner)
InvocationContextsetLockOwner in interface InvocationContextpublic final Set<Object> getLockedKeys()
InvocationContextgetLockedKeys in interface InvocationContextpublic final void addLockedKey(Object key)
InvocationContextaddLockedKey in interface InvocationContextpublic final GlobalTransaction getGlobalTransaction()
TxInvocationContextgetGlobalTransaction in interface TxInvocationContext<T extends AbstractCacheTransaction>public final boolean hasModifications()
TxInvocationContexthasModifications in interface TxInvocationContext<T extends AbstractCacheTransaction>public final List<WriteCommand> getModifications()
TxInvocationContextgetModifications in interface TxInvocationContext<T extends AbstractCacheTransaction>public final CacheEntry lookupEntry(Object key)
EntryLookuplookupEntry in interface EntryLookupkey - key to look uppublic final Map<Object,CacheEntry> getLookedUpEntries()
EntryLookupnull if the key does not exist in the cache.getLookedUpEntries in interface EntryLookuppublic final Set<Object> getAffectedKeys()
TxInvocationContextgetAffectedKeys in interface TxInvocationContext<T extends AbstractCacheTransaction>public final void addAllAffectedKeys(Collection<?> keys)
TxInvocationContextaddAllAffectedKeys in interface TxInvocationContext<T extends AbstractCacheTransaction>public final void addAffectedKey(Object key)
addAffectedKey in interface TxInvocationContext<T extends AbstractCacheTransaction>public final void putLookedUpEntry(Object key, CacheEntry e)
EntryLookupputLookedUpEntry in interface EntryLookupkey - key to storee - entry to storepublic final void removeLookedUpEntry(Object key)
removeLookedUpEntry in interface EntryLookuppublic final boolean isInTxScope()
InvocationContextisInTxScope in interface InvocationContextpublic final void clearLockedKeys()
clearLockedKeys in interface InvocationContextpublic final T getCacheTransaction()
getCacheTransaction in interface TxInvocationContext<T extends AbstractCacheTransaction>Copyright © 2021 JBoss by Red Hat. All rights reserved.