Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sequence of Interceptors

 
Anuj Singhal
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Pie
Posts: 2415
95
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic