Paul Robinson [https://community.jboss.org/people/paul.robinson] created the discussion
"Internal invocation of EJB3 bean methods" To view the discussion, visit: https://community.jboss.org/message/716885#716885 -------------------------------------------------------------- Hello, I have a scenario where I am using CDI to add an interceptor to an EJB method. The interceptor is as follows: @ServiceRequest @Interceptor public class ServiceRequestInterceptor { @AroundInvoke public Object intercept(InvocationContext ic) throws Throwable { Method serviceMethod = ic.getMethod(); Object serviceImpl = ic.getTarget(); ProtocolHandler protocolHandler = HandlerFactory.createInstance(serviceImpl, serviceMethod); return protocolHandler.proceed(ic); } } This registers the EJB implementation class and the intercepted method with my middleware. My middleware will then invoke methods on the EJB at various times. The problem I am having is that the EJB implementing instance is invoked directly, by my middleware, due to the way I am obtaining the reference. This doesn't seem like the right approach to me as it is bypassing the EJB3 interceptors. Also, the EJB may be re-allocated, pasivated, etc, which is going to result in odd behavior, I expect. Should I somehow look up the local stub to the EJB, based on what information I can gather from the implementation class; or is there a better way? Thanks, Paul. -------------------------------------------------------------- Reply to this message by going to Community [https://community.jboss.org/message/716885#716885] Start a new discussion in EJB3 at Community [https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
_______________________________________________ jboss-user mailing list [email protected] https://lists.jboss.org/mailman/listinfo/jboss-user
