Page 1 of 1

Singletone bean, concurrency and transactions

Posted: Tue Jan 06, 2015 5:25 pm
by Ciprian Mihalache
Hi Paul,
I am particularly interested about this scenario:
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 couldn't find a similar question.
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... :D
Could you please add couple new questions with various situations where <interceptor-order> could be used?
Thank you very much :)

Re: Singletone bean, concurrency and transactions

Posted: Wed Jan 07, 2015 11:19 am
by admin
Hi Ciprian,
I will look into this as soon as I get some time. Meanwhile could you please send us an email (support@...) with your orderid?

thank you,
Paul.