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