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
public class NonTxInvocationContext extends AbstractInvocationContext
Context to be used for non transactional calls, both remote and local.- Since:
- 4.0
- Author:
- Mircea.Markus@jboss.com
-
-
Constructor Summary
Constructors Constructor Description NonTxInvocationContext(int numEntries, Address origin)NonTxInvocationContext(Address origin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLockedKey(Object key)Tracks the given key as locked by this invocation context.voidclearLockedKeys()NonTxInvocationContextclone()Clones the invocation context.voidforEachEntry(BiConsumer<Object,CacheEntry> action)Execute an action for each entry in the context.Set<Object>getLockedKeys()Returns the set of keys that are locked for writing.ObjectgetLockOwner()Returns the in behalf of which locks will be acquired.Map<Object,CacheEntry>getLookedUpEntries()Retrieves a map of entries looked up within the current scope.booleanisInTxScope()Returns true if this call is performed in the context of an transaction, false otherwise.intlookedUpEntriesCount()CacheEntrylookupEntry(Object k)Retrieves 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.voidremoveLookedUpEntry(Object key)voidsetLockOwner(Object lockOwner)Sets the object to be used by lock owner.-
Methods inherited from class org.infinispan.context.impl.AbstractInvocationContext
getClassLoader, getOrigin, hasLockedKey, isEntryRemovedInContext, isOriginLocal, onEntryValueReplaced, setClassLoader
-
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
replaceValue
-
-
-
-
Method Detail
-
lookupEntry
public CacheEntry lookupEntry(Object k)
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
public void removeLookedUpEntry(Object key)
-
putLookedUpEntry
public void putLookedUpEntry(Object key, CacheEntry e)
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
public Map<Object,CacheEntry> 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
public void forEachEntry(BiConsumer<Object,CacheEntry> action)
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
public Object getLockOwner()
Description copied from interface:InvocationContextReturns the in behalf of which locks will be acquired.
-
setLockOwner
public void setLockOwner(Object lockOwner)
Description copied from interface:InvocationContextSets the object to be used by lock owner.
-
clone
public NonTxInvocationContext 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
public void addLockedKey(Object key)
Description copied from interface:InvocationContextTracks the given key as locked by this invocation context.
-
getLockedKeys
public Set<Object> getLockedKeys()
Description copied from interface:InvocationContextReturns the set of keys that are locked for writing.
-
clearLockedKeys
public void clearLockedKeys()
-
-