public final class ImmutableContext extends Object implements InvocationContext
Modifier and Type | Field and Description |
---|---|
static ImmutableContext |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
void |
addLockedKey(Object key)
Tracks the given key as locked by this invocation context.
|
void |
clearLockedKeys() |
InvocationContext |
clone()
Clones the invocation context.
|
Set<Object> |
getLockedKeys()
Returns the set of keys that are locked for writing.
|
Object |
getLockOwner()
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.
|
Address |
getOrigin() |
boolean |
hasLockedKey(Object key)
Returns true if the lock being tested is already held in the current scope, false otherwise.
|
boolean |
isEntryRemovedInContext(Object key) |
boolean |
isInTxScope()
Returns true if this call is performed in the context of an transaction, false otherwise.
|
boolean |
isOriginLocal()
Returns true if the call was originated locally, false if it is the result of a remote rpc.
|
CacheEntry |
lookupEntry(Object key)
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 |
removeLookedUpEntry(Object key) |
void |
setLockOwner(Object lockOwner)
Sets the object to be used by lock owner.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLockedKeys
forEachEntry, forEachValue, lookedUpEntriesCount, removeLookedUpEntries
public static final ImmutableContext INSTANCE
public CacheEntry lookupEntry(Object key)
EntryLookup
lookupEntry
in interface EntryLookup
key
- key to look uppublic Map<Object,CacheEntry> getLookedUpEntries()
EntryLookup
null
if the key does not exist in the cache.getLookedUpEntries
in interface EntryLookup
public void putLookedUpEntry(Object key, CacheEntry e)
EntryLookup
putLookedUpEntry
in interface EntryLookup
key
- key to storee
- entry to storepublic void removeLookedUpEntry(Object key)
removeLookedUpEntry
in interface EntryLookup
public boolean hasLockedKey(Object key)
InvocationContext
hasLockedKey
in interface InvocationContext
key
- lock to testpublic boolean isOriginLocal()
InvocationContext
isOriginLocal
in interface InvocationContext
public Address getOrigin()
getOrigin
in interface InvocationContext
public boolean isInTxScope()
InvocationContext
isInTxScope
in interface InvocationContext
public Object getLockOwner()
InvocationContext
getLockOwner
in interface InvocationContext
public void setLockOwner(Object lockOwner)
InvocationContext
setLockOwner
in interface InvocationContext
public Set<Object> getLockedKeys()
InvocationContext
getLockedKeys
in interface InvocationContext
public InvocationContext clone()
InvocationContext
clone
in interface InvocationContext
clone
in class Object
public void addLockedKey(Object key)
InvocationContext
addLockedKey
in interface InvocationContext
public void clearLockedKeys()
clearLockedKeys
in interface InvocationContext
public boolean isEntryRemovedInContext(Object key)
isEntryRemovedInContext
in interface InvocationContext
Copyright © 2021 JBoss by Red Hat. All rights reserved.