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 Details

    • NonTxInvocationContext

      public NonTxInvocationContext(int numEntries, Address origin)
    • NonTxInvocationContext

      public NonTxInvocationContext(Address origin)
  • Method Details

    • lookupEntry

      public CacheEntry lookupEntry(Object k)
      Description copied from interface: EntryLookup
      Retrieves 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: EntryLookup
      Puts an entry in the registry of looked up entries in the current scope.

      Parameters:
      key - key to store
      e - entry to store
    • getLookedUpEntries

      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.

      Returns:
      a map of looked up entries.
    • forEachEntry

      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.
    • lookedUpEntriesCount

      public int lookedUpEntriesCount()
      Returns:
      The number of entries wrapped in the context, including invalid entries.
    • isInTxScope

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

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

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

      public NonTxInvocationContext clone()
      Description copied from interface: InvocationContext
      Clones the invocation context.
      Specified by:
      clone in interface InvocationContext
      Overrides:
      clone in class AbstractInvocationContext
      Returns:
      A cloned instance of this invocation context instance
    • addLockedKey

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

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

      public void clearLockedKeys()