Hi!
In section 6.10 of my (free) electronic book, the following can be found on interceptor ordering:
The following specifies the order in which interceptors are invoked. This applies to all the different interceptor types with the corresponding interceptor methods:
• Business methods interceptors – around-invoke methods.
• Timeout method interceptors – around-timeout methods.
• Lifecycle event interceptors – PostConstruct, PreDestroy, PrePassivate, PostActivate methods.
The order in which interceptors are invoked is as follows:
• Default interceptors. Any default interceptors are invoked first in the order in which they are declared in the ejb- jar.xml deployment descriptor.
• Interceptors defined in @Interceptor annotated interceptor classes listed in an @Interceptors annotation on the target EJB class. Such interceptor methods are invoked in the order they are declared in the @Interceptors annotation. Interceptor methods of superclasses to the interceptor classes are invoked first, starting with the most general superclass and traversing down the inheritance hierarchy.
• Interceptors defined in @Interceptor annotated interceptor classes listed in an @Interceptors annotation on the target method in an EJB. Such interceptor methods are invoked in the order they are declared in the @Interceptors annotation annotating the EJB method to be invoked.
Interceptor methods of superclasses to the method-level interceptor classes are invoked first, starting with the most general superclass and traversing down the inheritance hierarchy.
• Interceptor methods defined in the target EJB class. Such interceptor methods are invoked, starting with those defined in the most general superclass and traversing down the inheritance hierarchy until finally invoking the interceptor methods in the target EJB class itself.
I even tried it. 2 @AroundInvoke fails at deployment.
However, I have formed this impression that Weblogic 12C and Glassfish 3.1.1 implementation of Interceptors is not complete,
and what is full of errors. Will shortly post the Error Description and Stack Trace here.
Anirudh Gupta wrote:
However, I have formed this impression that Weblogic 12C and Glassfish 3.1.1 implementation of Interceptors is not complete,
and what is full of errors. Will shortly post the Error Description and Stack Trace here.
I recommend also creating a bug-ticket for the relevant product. I do not know about Weblogic, but GlassFish, being open source, has a JIRA bugtracking system here: http://java.net/jira/browse/GLASSFISH I have had only good experiences from reporting bugs back to the community.
Best wishes!