Red Hat JBoss Enterprise Application Platform (EAP)
- For doing logging as well as some attribute propagation on every (remote) ejb call, need to define a global default interceptor in the container.
- The EJB Interceptor would apply to any application deployed in the EJB Container.
- The deployed applications should not define their own interceptors in the ejb-jar.xml.
- How can a EJB Interceptor be defined in a Module ?
- Is there an alternative method that can be called after onMessage.
EJB interceptors are defined at three levels,
- Default Level -- This is typically done in the ejb-jar.xml file, which is largely the application scope.
- Class Level --- This is done by including the @Interceptors annotation at the class level.
- Method Level -- This is done by declaring @Interceptors at the method level.
EJB interceptors always require one of the above to be configured in order for them to be invoked. You cannot avoid declaring them in ejb-jar.xml as that is required to trigger the interceptor.
There is currently no mechanism to define EJB interceptors server or EAR-wide.
- Learn more
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.