Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
Posts: 2781
174
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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!