Package org.jboss.ejb.client
Class TransactionInterceptor
- java.lang.Object
-
- org.jboss.ejb.client.TransactionInterceptor
-
- All Implemented Interfaces:
EJBClientInterceptor
public final class TransactionInterceptor extends Object implements EJBClientInterceptor
The client interceptor which associates the current transaction with the invocation. Additionally, it influences discovery to "stick" load-balanced requests to a single node during the scope of a transaction.- Author:
- David M. Lloyd, Jason T. Greene
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.ejb.client.EJBClientInterceptor
EJBClientInterceptor.Registration
-
-
Field Summary
Fields Modifier and Type Field Description static intPRIORITYThis interceptor's priority.
-
Constructor Summary
Constructors Constructor Description TransactionInterceptor()Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleInvocation(EJBClientInvocationContext context)Handle the invocation.ObjecthandleInvocationResult(EJBClientInvocationContext context)Handle the invocation result.SessionIDhandleSessionCreation(EJBSessionCreationInvocationContext context)Optionally handle a session creation invocation.
-
-
-
Field Detail
-
PRIORITY
public static final int PRIORITY
This interceptor's priority.- See Also:
- Constant Field Values
-
-
Method Detail
-
handleSessionCreation
public SessionID handleSessionCreation(EJBSessionCreationInvocationContext context) throws Exception
Description copied from interface:EJBClientInterceptorOptionally handle a session creation invocation. Explicit session creation is always a blocking operation. The default operation forwards to the next interceptor in the chain.- Specified by:
handleSessionCreationin interfaceEJBClientInterceptor- Parameters:
context- the session creation invocation context (notnull)- Returns:
- the stateful EJB locator (must not be
null) - Throws:
Exception- if an invocation error occurred
-
handleInvocation
public void handleInvocation(EJBClientInvocationContext context) throws Exception
Description copied from interface:EJBClientInterceptorHandle the invocation. Implementations may short-circuit the invocation by throwing an exception. This method should process any per-interceptor state and callEJBClientInvocationContext.sendRequest().- Specified by:
handleInvocationin interfaceEJBClientInterceptor- Parameters:
context- the invocation context- Throws:
Exception- if an invocation error occurs
-
handleInvocationResult
public Object handleInvocationResult(EJBClientInvocationContext context) throws Exception
Description copied from interface:EJBClientInterceptorHandle the invocation result. The implementation should generally callEJBClientInvocationContext.getResult()immediately and perform any post-invocation cleanup task in a finally block.- Specified by:
handleInvocationResultin interfaceEJBClientInterceptor- Parameters:
context- the invocation context- Returns:
- the invocation result, if any
- Throws:
Exception- if an invocation error occurred
-
-