1Z0-895 · Question #38
An ejb-jar also contains three interceptor classes: AInt, BInt, CInt. Each interceptor class defines an AroundInvoke method called intercept. The ejb-jar also contains a stateless session bean…
The correct answer is B. AInt, CInt, BInt. With the interceptor-order clauses Aint will be first in the order of interceptors. Within each group (default, class, method) the order of the interceptors are from left to right as defined in the @Interceptors annotation, and then the xml interceptors. In this scenario, with…
Question
Options
- AAInt
- BAInt, CInt, BInt
- CCInt, BInt, AInt
- DAInt, BInt, CInt
How the community answered
(43 responses)- A12% (5)
- B81% (35)
- C5% (2)
- D2% (1)
Explanation
With the interceptor-order clauses Aint will be first in the order of interceptors. Within each group (default, class, method) the order of the interceptors are from left to right as defined in the @Interceptors annotation, and then the xml interceptors. In this scenario, with the @Intercaptors ({CInt.class, BInt.class}) line, the ordering continues with CInt and BInt. Note 1: By default the ordering of interceptors when invoking a method are * External interceptors ** Default interceptors, if present ** Class interceptors, if present ** Method interceptors, if present *Bean class interceptor method Note 2: You can override the default sort order of the external interceptors by specifiying an interceptor-binding with an interceptor-order specifying the order of the interceptors Reference: EJB Interceptors
Topics
Community Discussion
No community discussion yet for this question.