I am particularly interested about this scenario:
I couldn't find a similar question.It is given 3 interceptor classes A, B, C.
B and C are declared at type level. @Interceptors({B, C});
interceptor-A didn't declared via annotations.
And we have a following descriptor:
<assembly-descriptor>
<interceptor-binding>
<ejb-name>SomeBean</ejb-name>
<interceptor-order>
<interceptor-class>A</interceptor-class>
</interceptor-order>
<method>
<method-name>foo</method-name>
</method>
</interceptor-binding>
</assembly-descriptor>
What will be the order for invocations?
1. B, C
2. A, B, C
3. B, C, A
4. A
I found here the following: If the interceptor-order element is used, the ordering specified at the given level must be a total order over ALL interceptor classes that have been defined at that level and above (unless they have been explicitly excluded).. So, I can assume that we defined in the descriptor a method-level interceptor, thus the other 2 class-level interceptors will not be invoked anymore, so the last option is the right one. Am I right? What would be the order of interceptors if the "<method>" part is missing from the descriptor? Even more, what would be the order of interceptors if "<method>" part is missing and we have "<ejb-name>*</ejb-name>" in the descriptor?
I also found here some explanations about interceptor-order, but I admit that I was unable to follow them...
Could you please add couple new questions with various situations where <interceptor-order> could be used?
Thank you very much