Package org.infinispan.context.impl
Class ClearInvocationContext
- java.lang.Object
-
- org.infinispan.context.impl.AbstractInvocationContext
-
- org.infinispan.context.impl.ClearInvocationContext
-
- All Implemented Interfaces:
Cloneable,EntryLookup,InvocationContext
public class ClearInvocationContext extends AbstractInvocationContext implements Cloneable
Implementation ofInvocationContextused by theClearCommand.- Since:
- 7.2
- Author:
- Pedro Ruivo
-
-
Constructor Summary
Constructors Constructor Description ClearInvocationContext(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()ClearInvocationContextclone()Clones the invocation 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.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.CacheEntrylookupEntry(Object key)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, 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
forEachEntry, forEachValue, lookedUpEntriesCount, removeLookedUpEntries
-
Methods inherited from interface org.infinispan.context.InvocationContext
replaceValue
-
-
-
-
Constructor Detail
-
ClearInvocationContext
public ClearInvocationContext(Address origin)
-
-
Method Detail
-
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
public Object getLockOwner()
Description copied from interface:InvocationContextReturns the in behalf of which locks will be acquired.- Specified by:
getLockOwnerin interfaceInvocationContext
-
setLockOwner
public void setLockOwner(Object lockOwner)
Description copied from interface:InvocationContextSets the object to be used by lock owner.- Specified by:
setLockOwnerin interfaceInvocationContext
-
clone
public ClearInvocationContext 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
-
getLockedKeys
public Set<Object> 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
public void addLockedKey(Object key)
Description copied from interface:InvocationContextTracks the given key as locked by this invocation context.- Specified by:
addLockedKeyin interfaceInvocationContext
-
hasLockedKey
public boolean hasLockedKey(Object key)
Description copied from interface:InvocationContextReturns true if the lock being tested is already held in the current scope, false otherwise.- Specified by:
hasLockedKeyin interfaceInvocationContext- Overrides:
hasLockedKeyin classAbstractInvocationContext- Parameters:
key- lock to test
-
isEntryRemovedInContext
public boolean isEntryRemovedInContext(Object key)
- Specified by:
isEntryRemovedInContextin interfaceInvocationContext- Overrides:
isEntryRemovedInContextin classAbstractInvocationContext
-
lookupEntry
public CacheEntry lookupEntry(Object key)
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.
-
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.- Specified by:
getLookedUpEntriesin interfaceEntryLookup- Returns:
- a map of looked up entries.
-
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.- Specified by:
putLookedUpEntryin interfaceEntryLookup- Parameters:
key- key to storee- entry to store
-
removeLookedUpEntry
public void removeLookedUpEntry(Object key)
- Specified by:
removeLookedUpEntryin interfaceEntryLookup
-
-