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
ConstructorsConstructorDescriptionNonTxInvocationContext(int numEntries, Address origin) NonTxInvocationContext(Address origin) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLockedKey(Object key) Tracks the given key as locked by this invocation context.voidclone()Clones the invocation context.voidforEachEntry(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.booleanReturns true if this call is performed in the context of an transaction, false otherwise.intRetrieves an entry from the collection of looked up entries in the current scope.voidputLookedUpEntry(Object key, CacheEntry e) Puts an entry in the registry of looked up entries in the current scope.voidvoidsetLockOwner(Object lockOwner) Sets the object to be used by lock owner.Methods inherited from class org.infinispan.context.impl.AbstractInvocationContext
getOrigin, hasLockedKey, isEntryRemovedInContext, isOriginLocal, publisherMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.context.EntryLookup
forEachValue, removeLookedUpEntriesMethods inherited from interface org.infinispan.context.InvocationContext
addLockedKeys
-
Constructor Details
-
NonTxInvocationContext
-
NonTxInvocationContext
-
-
Method Details
-
lookupEntry
Description copied from interface:EntryLookupRetrieves 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:EntryLookupPuts 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:EntryLookupRetrieves a map of entries looked up within the current scope. Note: The key inside the CacheEntry may benullif the key does not exist in the cache.- Returns:
- a map of looked up entries.
-
forEachEntry
Description copied from interface:EntryLookupExecute an action for each entry in the context. Includes invalid entries, which have anullvalue and may also report anullkey. -
lookedUpEntriesCount
public int lookedUpEntriesCount()- Returns:
- The number of entries wrapped in the context, including invalid entries.
-
isInTxScope
public boolean isInTxScope()Description copied from interface:InvocationContextReturns true if this call is performed in the context of an transaction, false otherwise. -
getLockOwner
Description copied from interface:InvocationContextReturns the in behalf of which locks will be acquired. -
setLockOwner
Description copied from interface:InvocationContextSets the object to be used by lock owner. -
clone
Description copied from interface:InvocationContextClones the invocation context.- Specified by:
clonein interfaceInvocationContext- Overrides:
clonein classAbstractInvocationContext- Returns:
- A cloned instance of this invocation context instance
-
addLockedKey
Description copied from interface:InvocationContextTracks the given key as locked by this invocation context. -
getLockedKeys
Description copied from interface:InvocationContextReturns the set of keys that are locked for writing. -
clearLockedKeys
public void clearLockedKeys()
-