To apply an interceptor class (auctionsystem.infra.EJBMonitor in this example) to all beans, add to the deployment descriptor (ejb-jar.xml):
<ejb-jar> <interceptors> <interceptor> <interceptor-class>auctionsystem.helper.EJBMonitor</interceptor-class> </interceptor> </interceptors> <assembly-descriptor> <interceptor-binding> <ejb-name>*</ejb-name> <interceptor-class>auctionsystem.helper.EJBMonitor</interceptor-class> </interceptor-binding> </assembly-descriptor> </ejb-jar>
The order in which interceptors are called is:
- default interceptors
- class level interceptors (interceptors on superclasses are called first)
- method level interceptors
- @ExcludeDefaultInterceptors
- @ExcludeClassInterceptors