Package org.infinispan.context
Interface InvocationContext
-
- All Superinterfaces:
Cloneable,EntryLookup
public interface InvocationContext extends EntryLookup, Cloneable
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
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidaddLockedKey(Object key)Tracks the given key as locked by this invocation context.default voidaddLockedKeys(Collection<?> keys)voidclearLockedKeys()InvocationContextclone()Clones the invocation context.ClassLoadergetClassLoader()Deprecated.Not in use any more, implementations might return null.Set<Object>getLockedKeys()Returns the set of keys that are locked for writing.ObjectgetLockOwner()Returns the in behalf of which locks will be acquired.org.infinispan.remoting.transport.AddressgetOrigin()booleanhasLockedKey(Object key)Returns true if the lock being tested is already held in the current scope, false otherwise.booleanisEntryRemovedInContext(Object key)booleanisInTxScope()Returns true if this call is performed in the context of an transaction, false otherwise.booleanisOriginLocal()Returns true if the call was originated locally, false if it is the result of a remote rpc.default booleanreplaceValue(Object key, org.infinispan.container.entries.InternalCacheEntry cacheEntry)Deprecated.Since 8.1, useEntryFactory.wrapExternalEntry(InvocationContext, Object, CacheEntry, boolean, boolean)instead.voidsetClassLoader(ClassLoader classLoader)Deprecated.Not in use any more.voidsetLockOwner(Object lockOwner)Sets the object to be used by lock owner.-
Methods inherited from interface org.infinispan.context.EntryLookup
forEachEntry, forEachValue, getLookedUpEntries, lookedUpEntriesCount, lookupEntry, putLookedUpEntry, removeLookedUpEntries, removeLookedUpEntry
-
-
-
-
Method Detail
-
isOriginLocal
boolean isOriginLocal()
Returns true if the call was originated locally, false if it is the result of a remote rpc.
-
getOrigin
org.infinispan.remoting.transport.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
void setLockOwner(Object lockOwner)
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
-
clearLockedKeys
void clearLockedKeys()
-
getClassLoader
@Deprecated ClassLoader getClassLoader()
Deprecated.Not in use any more, implementations might return null.Returns the class loader associated with this invocation- Returns:
- a class loader instance or null if no class loader was specifically associated
-
setClassLoader
@Deprecated void setClassLoader(ClassLoader classLoader)
Deprecated.Not in use any more.Sets the class loader associated for this invocation
-
addLockedKey
void addLockedKey(Object key)
Tracks the given key as locked by this invocation context.
-
addLockedKeys
default void addLockedKeys(Collection<?> keys)
-
hasLockedKey
boolean hasLockedKey(Object key)
Returns true if the lock being tested is already held in the current scope, false otherwise.- Parameters:
key- lock to test
-
replaceValue
@Deprecated default boolean replaceValue(Object key, org.infinispan.container.entries.InternalCacheEntry cacheEntry)
Deprecated.Since 8.1, useEntryFactory.wrapExternalEntry(InvocationContext, Object, CacheEntry, boolean, boolean)instead.
-
isEntryRemovedInContext
boolean isEntryRemovedInContext(Object key)
-
-