当我想要将 EJB 公开给同一应用程序服务器上的不同应用程序时,是否需要使用 @Remote?
我有一个 @Stateless @Local Bean 已成功部署在耳朵中。当我浏览 JNDI 树时,我可以看到新的 EJB 3.1 标准全局 JNDI 名称。 (java:global/product/product-ejb/ProductManagement)
我想在同一应用程序服务器上的不同应用程序中使用此EJB。我需要为此 EJB 添加远程接口吗?
I have a @Stateless @Local Bean successfully deployed in an ear. I can see the new EJB 3.1 standard global JNDI name when I browse the JNDI tree. (java:global/product/product-ejb/ProductManagement)
I want to use this EJB in a different application on the same app server. Do I need to add a remote interface for this EJB?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
规范不要求应用程序间访问本地客户端视图,但您的容器可能会选择支持。如果你希望你的应用程序是可移植的,你不应该依赖它并使用远程接口(一个像样的容器应该优化同一 JVM 内的调用)。来自 EJB 3.1 规范:
参考
Inter-application access to the local client view is not required by the specification but might be optionally supported by your container. If you want your application to be portable, you shouldn't rely on it and use a Remote interface (a decent container should optimize calls inside a same JVM anyway). From the EJB 3.1 specification:
References