EJB - Home / Remote和LocalHome / Local接口 [英] EJB - Home/Remote and LocalHome/Local interfaces

查看:149
本文介绍了EJB - Home / Remote和LocalHome / Local接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



初步调查结果的方案3:Exchange请求表明两个EJB将提供一个合适的解决方案:一个名为EnterExchangeRequest的会话bean来控制处理,一个称为ExchangeRequest的实体bean表示请求的持久属性。讨论以下界面的作用:




  • 首页

  • 远程

  • LocalHome

  • 本地



将提供对上述EJB服务的访问。



我可以尝试解释一下如何 Home 远程接口将适合图片。我也听说讲师说可以用 LocalHome Remote c替换 Home code>由本地(为什么?),但是为什么要我同时讨论所有四个角色?






当我说,EJB容器(应用服务器)会看到一个接口是首页远程然后决定该bean可以在集群中的任何机器上活,而在这种情况下接口是 LocalHome 本地容器将知道bean不能分布在多台机器上,因此将保持他们只在一台机器上活着?






我完全迷失在这个企业Java丛林中。我遇到一个BeanOverflow。你能告诉我哪些假设是错误的,指出我的误解和错误。



感谢所有愿意帮助我这些EJB界面的人。



请注意,我没有要求您回答过去考试的问题。如果您有任何疑问,请问这是什么问题。

解决方案

如Yishay,Home / Remote和LocalHome / Local绑定在一起,Home接口作为一个构造函数。



本地bean与他们所居住的JVM绑定在一起,您无法访问它们外。远程bean可以从其他JVM访问。



我使用类似的方法:我总是部署耳朵。豆为耳朵我做当地的豆,豆是为了让其他耳朵使用我做远程。但是可以在其他耳朵中使用本地bean,只要部署在同一个JVM中


Revising some past exam papers for an exam mainly focus on component-oriented design and J2EE, I have come across the following question:

A preliminary investigation of scenario 3: "Exchange Request" suggests that two EJBs will provide a suitable solution: a session bean called EnterExchangeRequest to control the processing and an entity bean called ExchangeRequest to represent the persistent properties of the request. Discuss the role of the following interfaces:

  • Home
  • Remote
  • LocalHome
  • Local

and how they would provide access to the services of the EJBs described above.

I could try to explain how Home and Remote interfaces would fit into the picture. I have also heard the lecturer say one could replace Home by LocalHome, and Remote by Local (why?), but why are they asking me to discuss the role of all four at the same time?


Do I get it right when I say, the EJB container (the application server) would see that an interface is Home or Remote and then decide that the bean can 'live' on any machine in the cluster, while in the case the interfaces are LocalHome and Local the container will know that the beans can't be distributed across multiple machines and will therefore keep them 'alive' in one machine only?


I am totally lost in this enterprise Java jungle. I am experiencing a BeanOverflow. Could you please tell me which of my assumptions are wrong, point out my misconceptions and blunders.

Thank you all who are willing to help me with these EJB interfaces.

P.S. Note that I am not asking you to answer the question from the past exam paper. Just curious if you have any thoughts as to what could they be after when asking this.

解决方案

As pointed out by Yishay, Home/Remote and LocalHome/Local are tied together and the Home interface functions as a constructor.

Local beans are tied to the JVM they live in, you can not access them from the outside. Remote beans can be accessed from other JVMs.

I use a similar approach: I always deploy ears. Beans for the ear I make local beans, Beans meant for use by other ears I make remote. But it is possible to use the local beans in other ears, as long as the are deployed in the same JVM

这篇关于EJB - Home / Remote和LocalHome / Local接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆