java - CDI interceptor Scope annotation -
context:
wildfly 8.1.0
cdi 1.2
according cdi
specification cdi1.2
, not need declare cdi in beans.xml
if annotated @priority(somepriorityvalue)
however, following cdi interceptors never called unless add @dependent
annotation
@requiresloggedinaccount @interceptor @priority(interceptor.priority.application) public class myinterceptor { @aroundinvoke public object intercept(final invocationcontext ic) throws exception { //intercept , then... return ic.proceed(); } }
and interceptor binding:
@inherited @documented @interceptorbinding @target({method, type}) @retention(runtime) public @interface requiresloggedinaccount { }
note interceptor binding , interceptor defined in different jar module used (so purpose @priority).
is have overlooked? why must add cdi
's @dependent
scope interceptor kick?
is because have stated in beans.xml
bean-discovery-mode="annotated"
wildfly 8.1 ships weld 2.1.x (i forget x, 2.1 cdi 1.1 compliant). can apply patches upgrade weld 2.2 cdi 1.2 compliant , issue should go away you.
the behavior you're seeing consistent cdi 1.1 implementations.
Comments
Post a Comment