1 Reply Latest reply on May 26, 2012 5:06 PM by calb

    Interceptor not triggered in JBoss AS 6.0.0.Final

    pi4630

      Hi,

       

      this is my SLSB:

       

      {code}

      @Stateless

      public class TestBean implements ITest {

       

          Logger log = Logger.getLogger(this.getClass());

          @Resource

          private TimerService timerService;

       

          @Override

          public void callMe() {

              String array[] = { "Pinco", "Pallo", "Pallino" };

              for (int i = 0; i < array.length; i++) {

                  timerService.createTimer(new Date(),(1 + i) * 60 * 1000, array[i] + " "+i);

              }

          }

       

          @Timeout

          @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)

          @Interceptors(TimerInterceptor.class)

          private void testMe(Timer t) {

              log.info("I am in timeout method");

              if (t != null) {

                  System.out.println((String) t.getInfo());

              }

       

          }

      {code}

      The TimerInterceptor class looks like this:

       

      {code}

      public class TimerInterceptor {

       

          Logger log = Logger.getLogger(this.getClass());

       

          @AroundTimeout

          public Object checkTimer(InvocationContext invContext) throws Exception {

              log.info("I am in interceptor");

              Timer t = (Timer) invContext.getTimer();

              String timerName = (String) t.getInfo();

       

       

              log.info("INTERCEPTOR: " + timerName);

       

              return invContext.proceed();

       

          }

      {code}

      I'd expect to find a log insertion, but there isn't. Breakpoint is also ignored. Am I missing something?

       

      Thanks