CDI doesn't give us an easy way to obtain the interceptor binding annotations from an interceptor call. See https://issues.jboss.org/browse/CDI-468 Weld 3 has a great workaround for this that can be used until there's an actual spec compliant solution:
Set<Annotation> bindings = (Set<Annotation>) invocationContext.getContextData().get("org.jboss.weld.interceptor.bindings");
|
Since this is a problem in Java EE 7 applications as well, it would be great if this feature could be back ported to Weld 2. |