Context:
Wildfly 8.1.0 with CDI 1.2
According to the specification CDIfor CDI1.2you do not need to declare cdi in beans.xmlif it is annotated@Priority(somepriorityvalue)
However, the following cdi interceptors are never called unless I add an @Dependentannotation
@RequiresLoggedInAccount
@Interceptor
@Priority(Interceptor.Priority.APPLICATION)
public class MyInterceptor {
@AroundInvoke
public Object intercept(final InvocationContext ic) throws Exception {
return ic.proceed();
}
}
and interceptor binding:
@Inherited
@Documented
@InterceptorBinding
@Target({METHOD, TYPE})
@Retention(RUNTIME)
public @interface RequiresLoggedInAccount {
}
Note that interceptor binding and interceptor are defined in another jar module from which they are used (therefore the goal is for @Priority).
Did I forget something? Why should I add an area CDI @Dependentfor an interceptor to strike?
This is because I specifically indicated in beans.xml bean-discovery-mode="annotated"
source
share