My Java EE 6 application consists of a war and an ejb module packaged in ear file. I\'m using CDI for DI (i.e. I have a beans.xml file in both modules). I want to use a logging
J2EE 7 specification says (reference):
The interceptors that you specify in the beans.xml file apply only to classes in the same archive. Use the @Priority annotation to specify interceptors globally for an application that consists of multiple modules
This solution has the advantage of being vendor independent.
An Example:
@Logged
@Interceptor
@Priority(Interceptor.Priority.APPLICATION)
public class LoggedInterceptor implements Serializable { ... }