加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – 当我想将EJB暴露给同一个应用服务器上的不同应用程序时,

发布时间:2020-12-14 05:59:15 所属栏目:Java 来源:网络整理
导读:我有一个@Stateless @Local Bean成功部署在耳朵里.当我浏览JNDI树时,我可以看到新的EJB 3.1标准全局JNDI名称. (JAVA的:全球/产品/产品EJB /产品经理) 我想在同一个应用服务器上的不同应用程序中使用此EJB.我是否需要为此EJB添加远程接口? 解决方法 规范不
我有一个@Stateless @Local Bean成功部署在耳朵里.当我浏览JNDI树时,我可以看到新的EJB 3.1标准全局JNDI名称. (JAVA的:全球/产品/产品EJB /产品经理)

我想在同一个应用服务器上的不同应用程序中使用此EJB.我是否需要为此EJB添加远程接口?

解决方法

规范不要求对本地客户端视图进行应用程序间访问,但容器可能选择支持.如果你希望你的应用程序是可移植的,你不应该依赖它并使用远程接口(一个像样的容器应该优化同一个JVM内的调用).从EJB 3.1规范:

3.2.2 Local Clients

Session beans may have local clients.
A local client is a client that is
collocated in the same JVM with the
session bean that provides the local
client view and which may be tightly
coupled to the bean. A local client of
a session bean may be another
enterprise bean or a web component.

Access to an enterprise bean through
the local client view requires the
collocation in the same JVM of both
the local client and the enterprise
bean that provides the local client
view. The local client view therefore
does not provide the location
transparency provided by the remote
client view.

Access to an enterprise bean through
the local client view is only required
to be supported for local clients
packaged within the same application
as the enterprise bean that provides
the local client view. Compliant
implementations of this specification
may optionally support access to the
local client view of an enterprise
bean from a local client packaged in a
different application
. The
configuration requirements for
inter-application access to the local
client view are vendor-specific and
are outside the scope of this
specification. Applications relying on
inter-application access to the local
client view are non-portable.

参考

> EJB 3.1规范

>第3.2.2节“本地客户端”

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读