-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
6.1.0.GA
I have a CDI which needs to inject "itself" in order to fire the interceptors defined in the bean methods.
I'm facing this limitation right now in JBoss EAP 6.1.
The injection actually works, but the aspects (i.e.: Interceptors) are not applied.
This scenario replicates the issue:
@Named @RequestScoped public class MyBean { @Inject private MyBean self; @Interceptors(InterceptorA.class) public void methodA() { self.methodB(); } @Interceptors(InterceptorB.class) public void methodB() { System.out.println("extra"); } }
When I call methodA, InterceptorA is called, but when this method calls methodB, the InterceptorB is never called.
If I instead, get a new MyBean reference from BeanManager, the interceptors work fine.
The other workaround I found was injecting a new bean which has methodB defined, however this implies creating a new class.
Thanks in advance for your thoughts.