[jboss-user] [EJB3] - Interceptor not triggered in JBoss AS 6.0.0.Final

Pasqualino Imbemba do-not-reply at jboss.com
Fri May 25 08:40:43 EDT 2012


Pasqualino Imbemba [https://community.jboss.org/people/pi4630] created the discussion

"Interceptor not triggered in JBoss AS 6.0.0.Final"

To view the discussion, visit: https://community.jboss.org/message/737939#737939

--------------------------------------------------------------
Hi,

this is my SLSB:


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());
        }

    }


The TimerInterceptor class looks like this:


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();

    }


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

Thanks
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/737939#737939]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120525/9956e22f/attachment-0001.html 


More information about the jboss-user mailing list