|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InvocationContextContainer
Manages the association between an InvocationContext
and the
calling thread. Also acts as a factory for creating various types of
InvocationContext
s.
Method Summary | |
---|---|
InvocationContext |
createInvocationContext()
If we are in a tx scope this will return an TxInvocationContext . |
NonTxInvocationContext |
createNonTxInvocationContext()
Will create an NonTxInvocationContext with the
NonTxInvocationContext.isOriginLocal() returning true. |
NonTxInvocationContext |
createRemoteInvocationContext()
Returns an NonTxInvocationContext whose
NonTxInvocationContext.isOriginLocal() flag will be true. |
RemoteTxInvocationContext |
createRemoteTxInvocationContext()
Returns an RemoteTxInvocationContext . |
LocalTxInvocationContext |
createTxInvocationContext()
Returns a LocalTxInvocationContext . |
InvocationContext |
getInvocationContext()
Returns the InvocationContext that is currently associated with the calling thread. |
void |
resume(InvocationContext ic)
Associates the supplied InvocationContext with the calling thread. |
InvocationContext |
suspend()
Disassociates thread's invocation context and returns the existing value. |
Method Detail |
---|
InvocationContext createInvocationContext()
TxInvocationContext
. Otherwise it will return an
NonTxInvocationContext
. Either way, both context will be
marked as local, i.e. InvocationContext.isOriginLocal()
will be true. The context is
also associated with the current thread, so further calls to getInvocationContext()
will return same instance.
NonTxInvocationContext createNonTxInvocationContext()
NonTxInvocationContext
with the
NonTxInvocationContext.isOriginLocal()
returning true.
LocalTxInvocationContext createTxInvocationContext()
LocalTxInvocationContext
. The context is also
associated with the current thread, so further calls to getInvocationContext()
will
return same instance.
RemoteTxInvocationContext createRemoteTxInvocationContext()
RemoteTxInvocationContext
. The context is also
associated with the current thread, so further calls to getInvocationContext()
will
return same instance.
NonTxInvocationContext createRemoteInvocationContext()
NonTxInvocationContext
whose
NonTxInvocationContext.isOriginLocal()
flag will be true.
The context is also associated with the current thread, so further calls to
getInvocationContext()
will return same instance.
InvocationContext getInvocationContext()
InvocationContext
that is currently associated with the calling thread.
Important: implementations of this method is most likely expensive (ThreadLocal.get), it is
recommended to cache the result of this method rather than repeating the call.
IllegalStateException
- if there is no context associated with the current thread.InvocationContext suspend()
void resume(InvocationContext ic)
InvocationContext
with the calling thread.
|
Google Analytics | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |