Hi Paven,
EJB Core Spec (page 307) says
"If a lifecycle callback interceptor method is overriden by another method (regardless of whether that method is itself a lifecycle interceptor callback interceptor method (of same or different type) ), it will not be invoked"
This is how I think this statement should be interpreted:
Let's say you created a ParentInterceptor class with @PostConstruct method init(), and a ChildInterceptor class that extends ParentInterceptor which is listed in the Interceptors annotation in a stateless session bean called MyBean:
@Stateless
@Interceptors(ChildInterceptor.class)
public class MyBean{
}
If the ChildInterceptor class does not override the init() method, then the ParentInterceptor.init() method would be invoked when stateless session bean MyBean is instantiated.
If you created method "@PostConstruct init()" in ChildInterceptor.class, than the ParentInterceptor.init() method would not be invoked and the ChildInterceptor.init() method would run when MyBean is instantiated.
If you created method init() without the @PostConstruct annotation in ChildInterceptor, then neither init() method would be invoked when MyBean is instantiated.
Remember, if you have defined a @PostConstruct method in MyBean, that method would still be invoked when you instantiate a MyBean, because it is unaffected by the overriding rules in your Interceptor class hierarchies.
This stuff gets complicated and messy when you try to think through all the permutations.