2 Replies Latest reply on Oct 3, 2008 10:02 AM by bfach

    Interceptors per MDB

    bfach

      Hello,

      I have setup my interceptor in such a fashion:

      @AroundInvoke()
      public Object onMessage(InvocationContext invocationContext) throws Exception{

      Object result = invocationContext.proceed();
      return result;

      }

      @MessageDriven
      class MDBclass {


      @Interceptors(RHMDBInterceptor.class)
      public void onMessage(Message msg) {

      // do something

      }

      }


      This works fine however I want to have a seperate INSTANCE of a interceptor for each separate deployment of the MDB class that is listed in the deployment descriptors. As it is now, the interceptor intercepts all calls to on message for all EJBs.

      I want an instance of the same interceptor for each MDB ejb deployment.

      I have found a few things but they are all different ways and i haven't figured out how to make them work. Any hints on how i could do this would be greatly appreciated.

      Thanks,

        • 1. Re: Interceptors per MDB
          wolfc

          My is guess is you're running into this issue: https://jira.jboss.org/jira/browse/EJBTHREE-1246.

          • 2. Re: Interceptors per MDB
            bfach

            Perhaps.

            There are so many methods of how to make an interceptor. The other way i saw was implementing the Interceptor interface and using the InterceptorDef annotation however when i attempted this, this did not work at all.

            I am searching for the solution that will could have 1 interceptor instance for 100 instances of a MDB. This interceptor would effectively maintain the "state" of the entire MDB.

            With that if i deploy another MDB in the same ear via deployment descriptors, another interceptor would be required to profile the new MDB.

            Thus 2 MDBs X j instances but still only 2 interceptors to profile each MDB.