2 Replies Latest reply on Jan 31, 2007 2:10 PM by ch333

    EJB3 Embeddable and @AroundInvoke

    tharter

      Just doesn't seem to be happening for me...

      @Stateless
      @SecurityDomain("etspolicy")
      public class UserManagerBean implements UserManager
      {

      @PersistenceContext(unitName = "etsdata")
      private EntityManager manager;

      @AroundInvoke
      public Object InvokerTest(InvocationContext ctx) throws Exception {
      System.out.println("Got to AroundInvoke'd method...");
      return ctx.proceed();
      }

      ...
      public String helloWorld() {
      return "hello world";
      }
      }

      helloWorld() is defined in my local interface, that works fine and dandy, but InvokerTest() definitely never fires. Haven't tested this deployed in JBoss (4.0.4GA) yet to see if the invokation happens, though the bean works fine there. We do a LOT of unit testing via embeddable/JUnit. I'd REALLY like to be able to test interception in unit test since we need to do a whole lot of audit logging etc.

      Basically my question is: SHOULD it work? Or is this just not a feature of embeddable that is working at this time?

        • 1. Re: EJB3 Embeddable and @AroundInvoke
          tharter

          Hmmm, OK, it DOES work fine in-container, just can't seem to get @AroundInvoke to work OUTSIDE the container.

          Is this an issue with embedded still expecting @AroundInvoke to be in javax.ejb?

          • 2. Re: EJB3 Embeddable and @AroundInvoke
            ch333

            Hi tharter,

            Just wonder if you ever found out an answer of your question ... I'm facing the similar problem. My interceptor works in the app server 4.0.4.GA but not the embedded container alpha7. If you have some information on this matter, can you please share with us?

            Thanks in advance.