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?