Package org.infinispan.context.impl
Class SingleKeyNonTxInvocationContext
java.lang.Object
org.infinispan.context.impl.SingleKeyNonTxInvocationContext
- All Implemented Interfaces:
Cloneable,EntryLookup,InvocationContext
- Author:
- Mircea Markus, Sanne Grinovero
-
Constructor Summary
Constructors -
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.voidforEachValue(BiConsumer<Object, CacheEntry> action) Execute an action for each value in the context.getKey()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.booleanhasLockedKey(Object key) Returns true if the lock being tested is already held in the current scope, false otherwise.booleanbooleanReturns true if this call is performed in the context of an transaction, false otherwise.booleanisKeyEquals(Object key) booleanReturns true if the call was originated locally, false if it is the result of a remote rpc.intlookupEntry(Object key) Retrieves an entry from the collection of looked up entries in the current scope.<K,V> org.reactivestreams.Publisher<CacheEntry<K, V>> Returns a Publisher that when subscribed to provide all values that have a value in the given context.voidputLookedUpEntry(Object key, CacheEntry e) Puts an entry in the registry of looked up entries in the current scope.voidvoidvoidsetLockOwner(Object lockOwner) Sets the object to be used by lock owner.toString()Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.infinispan.context.EntryLookup
removeLookedUpEntriesMethods inherited from interface org.infinispan.context.InvocationContext
addLockedKeys
-
Constructor Details
-
SingleKeyNonTxInvocationContext
-
-
Method Details
-
isOriginLocal
public boolean isOriginLocal()Description copied from interface:InvocationContextReturns true if the call was originated locally, false if it is the result of a remote rpc.- Specified by:
isOriginLocalin interfaceInvocationContext
-
isInTxScope
public boolean isInTxScope()Description copied from interface:InvocationContextReturns true if this call is performed in the context of an transaction, false otherwise.- Specified by:
isInTxScopein interfaceInvocationContext
-
getLockOwner
Description copied from interface:InvocationContextReturns the in behalf of which locks will be acquired.- Specified by:
getLockOwnerin interfaceInvocationContext
-
setLockOwner
Description copied from interface:InvocationContextSets the object to be used by lock owner.- Specified by:
setLockOwnerin interfaceInvocationContext
-
clone
Description copied from interface:InvocationContextClones the invocation context.- Specified by:
clonein interfaceInvocationContext- Overrides:
clonein classObject- Returns:
- A cloned instance of this invocation context instance
-
getLockedKeys
Description copied from interface:InvocationContextReturns the set of keys that are locked for writing.- Specified by:
getLockedKeysin interfaceInvocationContext
-
clearLockedKeys
public void clearLockedKeys()- Specified by:
clearLockedKeysin interfaceInvocationContext
-
addLockedKey
Description copied from interface:InvocationContextTracks the given key as locked by this invocation context.- Specified by:
addLockedKeyin interfaceInvocationContext
-
lookupEntry
Description copied from interface:EntryLookupRetrieves an entry from the collection of looked up entries in the current scope.- Specified by:
lookupEntryin interfaceEntryLookup- Parameters:
key- key to look up- Returns:
- an entry, or null if it cannot be found.
-
isKeyEquals
-
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.- Specified by:
getLookedUpEntriesin interfaceEntryLookup- 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.- Specified by:
forEachEntryin interfaceEntryLookup
-
forEachValue
Description copied from interface:EntryLookupExecute an action for each value in the context.Entries that do not have a value (because the key was removed, or it doesn't exist in the cache).
- Specified by:
forEachValuein interfaceEntryLookup
-
publisher
Description copied from interface:EntryLookupReturns a Publisher that when subscribed to provide all values that have a value in the given context.- Specified by:
publisherin interfaceEntryLookup- Type Parameters:
K- key type provided from userV- value type provided from user- Returns:
-
lookedUpEntriesCount
public int lookedUpEntriesCount()- Specified by:
lookedUpEntriesCountin interfaceEntryLookup- Returns:
- The number of entries wrapped in the context, including invalid entries.
-
putLookedUpEntry
Description copied from interface:EntryLookupPuts an entry in the registry of looked up entries in the current scope.- Specified by:
putLookedUpEntryin interfaceEntryLookup- Parameters:
key- key to storee- entry to store
-
removeLookedUpEntry
- Specified by:
removeLookedUpEntryin interfaceEntryLookup
-
getKey
-
getCacheEntry
-
getOrigin
- Specified by:
getOriginin interfaceInvocationContext- Returns:
- the origin of the command, or null if the command originated locally
-
hasLockedKey
Description copied from interface:InvocationContextReturns true if the lock being tested is already held in the current scope, false otherwise.- Specified by:
hasLockedKeyin interfaceInvocationContext- Parameters:
key- lock to test
-
isEntryRemovedInContext
- Specified by:
isEntryRemovedInContextin interfaceInvocationContext
-
resetState
public void resetState() -
toString
-