wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Sequence of Interceptors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Sequence of Interceptors" Watch "Sequence of Interceptors" New topic
Author

Sequence of Interceptors

Anuj Singhal
Greenhorn

Joined: Oct 17, 2003
Posts: 23
There are two interceptors defined for a given method; one at method level and one at class level.
What will be the sequence of execution?

@Stateless
@Interceptors(org.acme.AnotherInterceptor.class)
public class MyBean ... {
...
@Interceptors(org.acme.MyInterceptor.class)
public void someMethod() {
}
}
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1629
    
  23

Hi Anuj,

The sequence is class level first, then method level.

There are more possibilities, please check my notes (chapter 4.1 order of interceptors)

Regards,
Frits
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sequence of Interceptors
 
Similar Threads
Business method interceptor methods (AroundInvoke methods) invocation order
Invocation Order of Interceptors
disable annotated interceptors
@ExcludeClassInterceptors annotation
Query rgd interceptor invocation order