Interface EJBClientInterceptor

All Known Implementing Classes:
AuthenticationContextEJBClientInterceptor, DiscoveryEJBClientInterceptor, NamingEJBClientInterceptor, RemotingEJBClientInterceptor, TransactionInterceptor, TransactionPostDiscoveryInterceptor

public interface EJBClientInterceptor
An Enterprise Bean client interceptor, possibly protocol-specific. Client interceptors should not store any state locally since they are shared between all threads.

Interceptors are generally applied in priority order. Priority is determined by configuration or by the presence of an ClientInterceptorPriority annotation on the interceptor class. If priorities are equal, then the following configuration order applies:

  • Annotation-declared method-level interceptors
  • Annotation-declared class-level interceptors
  • Method-level configuration-declared interceptors
  • Class-level configuration-declared interceptors
  • Global configuration-declared interceptors
  • Interceptors found from class path
  • Globally installed default interceptors
Interceptors in the same configuration source are called in the order they were declared.
Author:
David M. Lloyd
  • Method Details

    • handleInvocation

      void handleInvocation(EJBClientInvocationContext context) throws Exception
      Handle the invocation. Implementations may short-circuit the invocation by throwing an exception. This method should process any per-interceptor state and call EJBClientInvocationContext.sendRequest().
      Parameters:
      context - the invocation context
      Throws:
      Exception - if an invocation error occurs
    • handleInvocationResult

      Object handleInvocationResult(EJBClientInvocationContext context) throws Exception
      Handle the invocation result. The implementation should generally call EJBClientInvocationContext.getResult() immediately and perform any post-invocation cleanup task in a finally block.
      Parameters:
      context - the invocation context
      Returns:
      the invocation result, if any
      Throws:
      Exception - if an invocation error occurred
    • handleSessionCreation

      default SessionID handleSessionCreation(EJBSessionCreationInvocationContext context) throws Exception
      Optionally handle a session creation invocation. Explicit session creation is always a blocking operation. The default operation forwards to the next interceptor in the chain.
      Parameters:
      context - the session creation invocation context (not null)
      Returns:
      the stateful Enterprise Beans locator (must not be null)
      Throws:
      Exception - if an invocation error occurred