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&...]