I would like to intercept calls to methods conversation.begin()
and conversation.end()
.
To do this, I have developed an interceptor binding that I aim to dynamically assign to the Conversation
class through a CDI portable extension.
However, I can not find how to access to the Conversation
class since it is not observed in the ProcessAnnotatedType
event where usually i do this process to my defined beans.
See the code as an example:
public class MethodCallsInterceptorExt implements Extension {
void processAnnotatedType(@Observes ProcessAnnotatedType<?> event) {
if (isConvesationBean(event)) { // This condition is never true
event.configureAnnotatedType().add(new MyInterceptorBinding());
}
}
}
Is this solution at least partially correct? Is there any viable way to do this?