org.infinispan.context
Class AbstractInvocationContextContainer

java.lang.Object
  extended by org.infinispan.context.AbstractInvocationContextContainer
All Implemented Interfaces:
InvocationContextContainer
Direct Known Subclasses:
NonTransactionalInvocationContextContainer, TransactionalInvocationContextContainer

public abstract class AbstractInvocationContextContainer
extends Object
implements InvocationContextContainer

Base class for InvocationContextContainer implementations.

Since:
5.1
Author:
Mircea Markus

Field Summary
protected  ThreadLocal<InvocationContext> ctxHolder
           
 
Fields inherited from interface org.infinispan.context.InvocationContextContainer
UNBOUNDED
 
Constructor Summary
AbstractInvocationContextContainer()
           
 
Method Summary
 void clearThreadLocal()
          Must be called as each thread exists the interceptor chain.
 InvocationContext createRemoteInvocationContextForCommand(VisitableCommand cacheCommand, Address origin)
          As InvocationContextContainer.createRemoteInvocationContext(org.infinispan.remoting.transport.Address), but returning the flags to the context from the Command if any Flag was set.
 InvocationContext getInvocationContext(boolean quiet)
          Returns the InvocationContext that is currently associated with the calling thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.infinispan.context.InvocationContextContainer
createInvocationContext, createInvocationContext, createNonTxInvocationContext, createRemoteInvocationContext, createRemoteTxInvocationContext, createSingleKeyNonTxInvocationContext, createTxInvocationContext
 

Field Detail

ctxHolder

protected final ThreadLocal<InvocationContext> ctxHolder
Constructor Detail

AbstractInvocationContextContainer

public AbstractInvocationContextContainer()
Method Detail

createRemoteInvocationContextForCommand

public InvocationContext createRemoteInvocationContextForCommand(VisitableCommand cacheCommand,
                                                                 Address origin)
Description copied from interface: InvocationContextContainer
As InvocationContextContainer.createRemoteInvocationContext(org.infinispan.remoting.transport.Address), but returning the flags to the context from the Command if any Flag was set.

Specified by:
createRemoteInvocationContextForCommand in interface InvocationContextContainer
origin - the origin of the command, or null if local

getInvocationContext

public InvocationContext getInvocationContext(boolean quiet)
Description copied from interface: InvocationContextContainer
Returns the InvocationContext that is currently associated with the calling thread. Important: implementations of this method are most likely expensive, involving thread locals. It is recommended to cache the result of this method rather than repeating the call.

Specified by:
getInvocationContext in interface InvocationContextContainer

clearThreadLocal

public void clearThreadLocal()
Description copied from interface: InvocationContextContainer
Must be called as each thread exists the interceptor chain.

Specified by:
clearThreadLocal in interface InvocationContextContainer

-->

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