Package org.infinispan.context
Interface InvocationContext
- All Superinterfaces:
Cloneable
,EntryLookup
- All Known Subinterfaces:
TxInvocationContext<T>
- All Known Implementing Classes:
AbstractInvocationContext
,AbstractTxInvocationContext
,ClearInvocationContext
,ImmutableContext
,LocalTxInvocationContext
,NonTxInvocationContext
,RemoteTxInvocationContext
,SingleKeyNonTxInvocationContext
A context that contains information pertaining to a given invocation. These contexts typically have the lifespan of
a single invocation.
- Since:
- 4.0
- Author:
- Manik Surtani (manik@jboss.org), Mircea.Markus@jboss.com
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLockedKey
(Object key) Tracks the given key as locked by this invocation context.default void
addLockedKeys
(Collection<?> keys) void
clone()
Clones the invocation context.Returns the set of keys that are locked for writing.Returns the in behalf of which locks will be acquired.boolean
hasLockedKey
(Object key) Returns true if the lock being tested is already held in the current scope, false otherwise.boolean
Deprecated.Since 11, to be removed in 14 with no replacementboolean
Returns true if this call is performed in the context of an transaction, false otherwise.boolean
Returns true if the call was originated locally, false if it is the result of a remote rpc.void
setLockOwner
(Object lockOwner) Sets the object to be used by lock owner.Methods inherited from interface org.infinispan.context.EntryLookup
forEachEntry, forEachValue, getLookedUpEntries, lookedUpEntriesCount, lookupEntry, publisher, putLookedUpEntry, removeLookedUpEntries, removeLookedUpEntry
-
Method Details
-
isOriginLocal
boolean isOriginLocal()Returns true if the call was originated locally, false if it is the result of a remote rpc. -
getOrigin
Address getOrigin()- Returns:
- the origin of the command, or null if the command originated locally
-
isInTxScope
boolean isInTxScope()Returns true if this call is performed in the context of an transaction, false otherwise. -
getLockOwner
Object getLockOwner()Returns the in behalf of which locks will be acquired. -
setLockOwner
Sets the object to be used by lock owner. -
clone
InvocationContext clone()Clones the invocation context.- Returns:
- A cloned instance of this invocation context instance
-
getLockedKeys
Returns the set of keys that are locked for writing. -
clearLockedKeys
void clearLockedKeys() -
addLockedKey
Tracks the given key as locked by this invocation context. -
addLockedKeys
-
hasLockedKey
Returns true if the lock being tested is already held in the current scope, false otherwise.- Parameters:
key
- lock to test
-
isEntryRemovedInContext
Deprecated.Since 11, to be removed in 14 with no replacement
-