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, isOriginLocal
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTransaction, isImplicitTransaction, isTransactionValid
addLockedKeys, clone, getOrigin, hasLockedKey, isEntryRemovedInContext, isOriginLocal
forEachEntry, forEachValue, lookedUpEntriesCount, removeLookedUpEntries
public Object getLockOwner()
InvocationContext
getLockOwner
in interface InvocationContext
public void setLockOwner(Object lockOwner)
InvocationContext
setLockOwner
in interface InvocationContext
public final Set<Object> getLockedKeys()
InvocationContext
getLockedKeys
in interface InvocationContext
public final void addLockedKey(Object key)
InvocationContext
addLockedKey
in interface InvocationContext
public final GlobalTransaction getGlobalTransaction()
TxInvocationContext
getGlobalTransaction
in interface TxInvocationContext<T extends AbstractCacheTransaction>
public final boolean hasModifications()
TxInvocationContext
hasModifications
in interface TxInvocationContext<T extends AbstractCacheTransaction>
public final List<WriteCommand> getModifications()
TxInvocationContext
getModifications
in interface TxInvocationContext<T extends AbstractCacheTransaction>
public final CacheEntry lookupEntry(Object key)
EntryLookup
lookupEntry
in interface EntryLookup
key
- key to look uppublic final Map<Object,CacheEntry> getLookedUpEntries()
EntryLookup
null
if the key does not exist in the cache.getLookedUpEntries
in interface EntryLookup
public final Set<Object> getAffectedKeys()
TxInvocationContext
getAffectedKeys
in interface TxInvocationContext<T extends AbstractCacheTransaction>
public final void addAllAffectedKeys(Collection<?> keys)
TxInvocationContext
addAllAffectedKeys
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)
EntryLookup
putLookedUpEntry
in interface EntryLookup
key
- key to storee
- entry to storepublic final void removeLookedUpEntry(Object key)
removeLookedUpEntry
in interface EntryLookup
public final boolean isInTxScope()
InvocationContext
isInTxScope
in interface InvocationContext
public final void clearLockedKeys()
clearLockedKeys
in interface InvocationContext
public final T getCacheTransaction()
getCacheTransaction
in interface TxInvocationContext<T extends AbstractCacheTransaction>
Copyright © 2021 JBoss by Red Hat. All rights reserved.