Package org.infinispan.context.impl
Class NonTxInvocationContext
java.lang.Object
org.infinispan.context.impl.AbstractInvocationContext
org.infinispan.context.impl.NonTxInvocationContext
- All Implemented Interfaces:
Cloneable
,EntryLookup
,InvocationContext
Context to be used for non transactional calls, both remote and local.
- Since:
- 4.0
- Author:
- Mircea.Markus@jboss.com
-
Constructor Summary
ConstructorDescriptionNonTxInvocationContext
(int numEntries, Address origin) NonTxInvocationContext
(Address origin) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLockedKey
(Object key) Tracks the given key as locked by this invocation context.void
clone()
Clones the invocation context.void
forEachEntry
(BiConsumer<Object, CacheEntry> action) Execute an action for each entry in the context.Returns the set of keys that are locked for writing.Returns the in behalf of which locks will be acquired.Retrieves a map of entries looked up within the current scope.boolean
Returns true if this call is performed in the context of an transaction, false otherwise.int
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
void
setLockOwner
(Object lockOwner) Sets the object to be used by lock owner.Methods inherited from class org.infinispan.context.impl.AbstractInvocationContext
getOrigin, hasLockedKey, isEntryRemovedInContext, isOriginLocal, publisher
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.infinispan.context.EntryLookup
forEachValue, removeLookedUpEntries
Methods inherited from interface org.infinispan.context.InvocationContext
addLockedKeys
-
Constructor Details
-
NonTxInvocationContext
-
NonTxInvocationContext
-
-
Method Details
-
lookupEntry
Description copied from interface:EntryLookup
Retrieves an entry from the collection of looked up entries in the current scope.- Parameters:
k
- key to look up- Returns:
- an entry, or null if it cannot be found.
-
removeLookedUpEntry
-
putLookedUpEntry
Description copied from interface:EntryLookup
Puts an entry in the registry of looked up entries in the current scope.- Parameters:
key
- key to storee
- entry to store
-
getLookedUpEntries
Description copied from interface:EntryLookup
Retrieves a map of entries looked up within the current scope. Note: The key inside the CacheEntry may benull
if the key does not exist in the cache.- Returns:
- a map of looked up entries.
-
forEachEntry
Description copied from interface:EntryLookup
Execute an action for each entry in the context. Includes invalid entries, which have anull
value and may also report anull
key. -
lookedUpEntriesCount
public int lookedUpEntriesCount()- Returns:
- The number of entries wrapped in the context, including invalid entries.
-
isInTxScope
public boolean isInTxScope()Description copied from interface:InvocationContext
Returns true if this call is performed in the context of an transaction, false otherwise. -
getLockOwner
Description copied from interface:InvocationContext
Returns the in behalf of which locks will be acquired. -
setLockOwner
Description copied from interface:InvocationContext
Sets the object to be used by lock owner. -
clone
Description copied from interface:InvocationContext
Clones the invocation context.- Specified by:
clone
in interfaceInvocationContext
- Overrides:
clone
in classAbstractInvocationContext
- Returns:
- A cloned instance of this invocation context instance
-
addLockedKey
Description copied from interface:InvocationContext
Tracks the given key as locked by this invocation context. -
getLockedKeys
Description copied from interface:InvocationContext
Returns the set of keys that are locked for writing. -
clearLockedKeys
public void clearLockedKeys()
-