org.infinispan.context.impl
Class NonTxInvocationContext

java.lang.Object
  extended by org.infinispan.context.impl.AbstractInvocationContext
      extended by org.infinispan.context.impl.NonTxInvocationContext
All Implemented Interfaces:
Cloneable, EntryLookup, FlagContainer, 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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.infinispan.context.impl.AbstractInvocationContext
AbstractInvocationContext.ContextFlag
 
Field Summary
protected  Set<Object> lockedKeys
           
protected  Map<Object,CacheEntry> lookedUpEntries
           
 
Fields inherited from class org.infinispan.context.impl.AbstractInvocationContext
contextFlags, flags
 
Constructor Summary
NonTxInvocationContext()
           
NonTxInvocationContext(int numEntries, boolean local)
           
 
Method Summary
 void addLockedKey(Object key)
          Tracks the given key as locked by this invocation context.
 void clearLockedKeys()
           
 void clearLookedUpEntries()
          Clears the collection of entries looked up
 NonTxInvocationContext 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 aquired.
 Map<Object,CacheEntry> getLookedUpEntries()
          Retrieves a map of entries looked up within the current scope.
 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 k)
          Retrieves an entry from the collection of looked up entries in the current scope.
 void putLookedUpEntries(Map<Object,CacheEntry> newLookedUpEntries)
           
 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 reset()
           
 void setOriginLocal(boolean originLocal)
           
 
Methods inherited from class org.infinispan.context.impl.AbstractInvocationContext
getClassLoader, getFlags, getOrigin, hasFlag, hasLockedKey, isContextFlagSet, isFlagsUninitialized, isUseFutureReturnType, setClassLoader, setContextFlag, setContextFlag, setFlags, setFlags, setOrigin, setUseFutureReturnType, toString, unsetContextFlag
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lookedUpEntries

protected final Map<Object,CacheEntry> lookedUpEntries

lockedKeys

protected Set<Object> lockedKeys
Constructor Detail

NonTxInvocationContext

public NonTxInvocationContext(int numEntries,
                              boolean local)

NonTxInvocationContext

public NonTxInvocationContext()
Method Detail

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

putLookedUpEntries

public void putLookedUpEntries(Map<Object,CacheEntry> newLookedUpEntries)

clearLookedUpEntries

public void clearLookedUpEntries()
Description copied from interface: EntryLookup
Clears the collection of entries looked up


getLookedUpEntries

public Map<Object,CacheEntry> getLookedUpEntries()
Description copied from interface: EntryLookup
Retrieves a map of entries looked up within the current scope.

Returns:
a map of looked up entries.

isOriginLocal

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.


setOriginLocal

public void setOriginLocal(boolean originLocal)

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 aquired.


reset

public void reset()
Specified by:
reset in interface FlagContainer
Overrides:
reset in class AbstractInvocationContext

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()

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.