Interceptors 1.2
This contains annotations and interfaces for defining interceptor methods and interceptor classes and for binding interceptor classes to target classes.
Interceptor classes
An interceptor class is a class that establishes a set of operations to carry out when a bean is invoked. It is marked with @Interceptor
:
@Interceptor public class AuditInterceptor { ...}
Or through the beans.xml
file:
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd" bean-discovery-mode="none"> <interceptors> <class> it.vige.businesscomponents.injection.Interceptor.AuditInterceptor </class> </interceptors> </beans>
Look at the none in the bean-discovery-mode property. In WildFly, the file markup for the interceptors works only if set to none. It is done to encourage the...