Class SingleKeyNonTxInvocationContext

java.lang.Object
org.infinispan.context.impl.SingleKeyNonTxInvocationContext
All Implemented Interfaces:
Cloneable, EntryLookup, InvocationContext

public final class SingleKeyNonTxInvocationContext extends Object implements InvocationContext
Author:
Mircea Markus, Sanne Grinovero
  • Constructor Details Link icon

    • SingleKeyNonTxInvocationContext Link icon

      public SingleKeyNonTxInvocationContext(Address origin)
  • Method Details Link icon

    • isOriginLocal Link icon

      public boolean isOriginLocal()
      Description copied from interface: InvocationContext
      Returns true if the call was originated locally, false if it is the result of a remote rpc.
      Specified by:
      isOriginLocal in interface InvocationContext
    • isInTxScope Link icon

      public boolean isInTxScope()
      Description copied from interface: InvocationContext
      Returns true if this call is performed in the context of an transaction, false otherwise.
      Specified by:
      isInTxScope in interface InvocationContext
    • getLockOwner Link icon

      public Object getLockOwner()
      Description copied from interface: InvocationContext
      Returns the in behalf of which locks will be acquired.
      Specified by:
      getLockOwner in interface InvocationContext
    • setLockOwner Link icon

      public void setLockOwner(Object lockOwner)
      Description copied from interface: InvocationContext
      Sets the object to be used by lock owner.
      Specified by:
      setLockOwner in interface InvocationContext
    • clone Link icon

      public InvocationContext clone()
      Description copied from interface: InvocationContext
      Clones the invocation context.
      Specified by:
      clone in interface InvocationContext
      Overrides:
      clone in class Object
      Returns:
      A cloned instance of this invocation context instance
    • getLockedKeys Link icon

      public Set<Object> getLockedKeys()
      Description copied from interface: InvocationContext
      Returns the set of keys that are locked for writing.
      Specified by:
      getLockedKeys in interface InvocationContext
    • clearLockedKeys Link icon

      public void clearLockedKeys()
      Specified by:
      clearLockedKeys in interface InvocationContext
    • addLockedKey Link icon

      public void addLockedKey(Object key)
      Description copied from interface: InvocationContext
      Tracks the given key as locked by this invocation context.
      Specified by:
      addLockedKey in interface InvocationContext
    • lookupEntry Link icon

      public CacheEntry lookupEntry(Object key)
      Description copied from interface: EntryLookup
      Retrieves an entry from the collection of looked up entries in the current scope.
      Specified by:
      lookupEntry in interface EntryLookup
      Parameters:
      key - key to look up
      Returns:
      an entry, or null if it cannot be found.
    • isKeyEquals Link icon

      public boolean isKeyEquals(Object key)
    • getLookedUpEntries Link icon

      public Map<Object, CacheEntry> getLookedUpEntries()
      Description copied from interface: EntryLookup
      Retrieves a map of entries looked up within the current scope. Note: The key inside the CacheEntry may be null if the key does not exist in the cache.
      Specified by:
      getLookedUpEntries in interface EntryLookup
      Returns:
      a map of looked up entries.
    • forEachEntry Link icon

      public void forEachEntry(BiConsumer<Object, CacheEntry> action)
      Description copied from interface: EntryLookup
      Execute an action for each entry in the context. Includes invalid entries, which have a null value and may also report a null key.
      Specified by:
      forEachEntry in interface EntryLookup
    • forEachValue Link icon

      public void forEachValue(BiConsumer<Object, CacheEntry> action)
      Description copied from interface: EntryLookup
      Execute 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:
      forEachValue in interface EntryLookup
    • publisher Link icon

      public <K,V> org.reactivestreams.Publisher<CacheEntry<K,V>> publisher()
      Description copied from interface: EntryLookup
      Returns a Publisher that when subscribed to provide all values that have a value in the given context.
      Specified by:
      publisher in interface EntryLookup
      Type Parameters:
      K - key type provided from user
      V - value type provided from user
      Returns:
    • lookedUpEntriesCount Link icon

      public int lookedUpEntriesCount()
      Specified by:
      lookedUpEntriesCount in interface EntryLookup
      Returns:
      The number of entries wrapped in the context, including invalid entries.
    • putLookedUpEntry Link icon

      public void putLookedUpEntry(Object key, CacheEntry e)
      Description copied from interface: EntryLookup
      Puts an entry in the registry of looked up entries in the current scope.
      Specified by:
      putLookedUpEntry in interface EntryLookup
      Parameters:
      key - key to store
      e - entry to store
    • removeLookedUpEntry Link icon

      public void removeLookedUpEntry(Object key)
      Specified by:
      removeLookedUpEntry in interface EntryLookup
    • getKey Link icon

      public Object getKey()
    • getCacheEntry Link icon

      public CacheEntry getCacheEntry()
    • getOrigin Link icon

      public Address getOrigin()
      Specified by:
      getOrigin in interface InvocationContext
      Returns:
      the origin of the command, or null if the command originated locally
    • hasLockedKey Link icon

      public boolean hasLockedKey(Object key)
      Description copied from interface: InvocationContext
      Returns true if the lock being tested is already held in the current scope, false otherwise.
      Specified by:
      hasLockedKey in interface InvocationContext
      Parameters:
      key - lock to test
    • isEntryRemovedInContext Link icon

      public boolean isEntryRemovedInContext(Object key)
      Specified by:
      isEntryRemovedInContext in interface InvocationContext
    • resetState Link icon

      public void resetState()
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object