我有一个带模块的EAR:
在foo-api中有:
@Local
FooService // (interface of a local stateless session bean)
Run Code Online (Sandbox Code Playgroud)
在foo-impl中有:
@Stateless
FooServiceImpl implements FooService //(implementation of the foo service)
Run Code Online (Sandbox Code Playgroud)
在interceptor.jar我想要
public class BazInterceptor {
@EJB
private FooService foo;
@AroundInvoke
public Object intercept( final InvocationContext i) throws Exception {
// do someting with foo service
return i.proceed();
}
Run Code Online (Sandbox Code Playgroud)
问题是:
Java EE 5兼容的应用程序服务器(例如JBoss 5)是否会注入拦截器?如果不是,访问会话bean的好策略是什么?
考虑: