[jboss-user] [EJB 3.0] - Method-level interceptors & callback methods

ivan.rododendro do-not-reply at jboss.com
Fri Oct 3 12:05:39 EDT 2008


Hello, 
we're running under JBAS 5CR2 and it seems that callback methods on Interceptors are not called if the interceptor is declared method-level on the EJB. 


  | public class MyInterceptor {
  |  
  |   @PostConstruct
  |   public void init(InvocationContext c) {
  |      // do some stuff
  |   }
  | 
  | }
  | 
  | @Stateless
  | public class MyBean implements MyRemote {
  | 
  |   @Interceptors(MyInterceptor.class)
  |   public void myMethod {
  |   // do some business stuff
  |   }
  | }
  | 

So init() method of interceptor class is never called. 

If I declare the same interceptor as a class-level, init() method is correctly called.  

>From what I can understand from EJB3 Spec and jboss docs, externals interceptor should have always the same lifecycle (which is tied to bean's lifecycle) no matter if they are declared class-level or method-level.

Am I wrong? Is there already a bug on JIRA ?

Thanks
Ivan 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180328#4180328

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180328



More information about the jboss-user mailing list