[cdi-dev] Interceptor bindings from interceptor when using 2.0 interception factory

arjan tijms arjan.tijms at gmail.com
Mon Aug 21 07:45:50 EDT 2017


Hi,

Normally a workaround to get the interceptor bindings from within an
Interceptor is to inspect the target and/or the injected intercepted bean.

However, when adding an interceptor via the new CDI 2.0 interception
factory, things become a bit more muddy.

See e.g.

https://github.com/javaee-samples/javaee8-samples/blob/master/cdi/interception-factory/src/main/java/org/javaee8/cdi/interception/factory/MyGreetingProducer.java#L34


Weld has the following method to get the bindings from the
InvocationContext:

Set<Annotation> bindings = (Set<Annotation>)
invocationContext.getContextData().get("org.jboss.weld.interceptor.bindings");

But this is obviously non-standard.

Is there a standard way to get the bindings? Perhaps getting hold of the
Bean<T> that represents the current Interceptor?

Kind regards,
Arjan Tijms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20170821/d3e85bfe/attachment.html 


More information about the cdi-dev mailing list