`
- 浏览:
316285 次
- 来自:
...
-
从JBUIDER6中翻译的关于接口的资料:
一个EJB至少为会话BEAN或实体BEAN提供两种接口。对于EJB 1.x,你至少要创建一个home interface和remote interface;对于EJB 2.0可以有一个Remote home,Remote interface,还可以有一个Local home,Local interface。Remote home,Remote interface为客户端提供了BEAN的远程视图,而Local home,Local interface为客户端提供了BEAN的本地视图。remote and/or local home interface定义了客户端程序用来创建、定位、销毁BEAN实例的方法;remote/local interface实现了BEAN的商业方法客户端是通过remote/local interface来访问这些方法的。
BEAN的home interface,无论是remote还是local,控制了BEAN的生命周期。它包含了创建、查找、删除一个BEAN实例的方法。作为BEAN的提供商,你必须定义home 接口,但可以不实现它。EJB容器会产生一个home对象,并返回一个引用给BEAN。
一个EJB的客户端可以有BEAN的远程视图或本地视图,remote bean有一个home interface,它扩展了EJBHome interface;local bean有一个home interface,它扩展了EJBLocalHome interface。每个remote /local interface都扩展了javax.ejb.EJBHome interface。
一个实体BEAN是被设计用来为多个客户端服务的,一个客户端创建了实体BEAN,其他客户端也应该可以使用它。
remote or local interface描述了客户端程序可以调用的商业方法。当在remote or local interface中定义了这些方法后,你要在BEAN class中实现它,客户端不会直接访问BEAN,他们是通过remote or local interface来访问这些方法的。
remote or local interface中定义的方法必须遵守以下原则:
它必须是public的;
如果是定义在remote interface中的方法,它必须抛出java.rmi.RemoteException;如果不是,它不能抛出java.rmi.RemoteException。
所有客户端能访问的方法必须在remote or local interface中定义。
BEAN的interface的几种选择:
选择Remote意味着EJB Designer生成一个Bean class,Remote home和Remote interface。
选择Local意味着EJB Designer生成一个Bean class,Local home和Local interface。
如果选择Remote/Local,EJB Designer将生成Bean class,Remote home,Remote interface,Local home和Local interface。在JBUILDER中,会话BEAN默认是remote的,实体BEAN默认是local的。
如果你为一个会话BEAN (Component)选择了Remote/Local,将生成的文件如下:
ComponentHome - the remote home interface;
ComponentBean - the bean class;
Component - the remote interface ;
ComponentLocalHome - the local home interface ;
ComponentLocal - the local interface。
如果你为一个实体BEAN (Component)选择了Remote/Local,将生成的文件如下:
ComponentHome - the local home interface ;
ComponentBean - the bean class ;
Component - the local interface ;
ComponentRemoteHome - the remote home interface ;
ComponentRemote - the remote interface。
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
NULL 博文链接:https://676744379-qq-com.iteye.com/blog/1853336
Tomcat下web工程调用JBOSS部署的EJB项目 此源码包 包括local本地调用及remote远程调用 文档说明在http://blog.csdn.net/heardy/article/details/6906225
在Weblogic10.3中,使用本地接口访问EJB3.0
ejb服务端工程,myeclipse工程
javax.ejb.Local.class javax.ejb.LocalBean.class javax.ejb.LocalHome.class javax.ejb.Lock.class javax.ejb.LockType.class javax.ejb.MessageDriven.class javax.ejb.MessageDrivenBean.class javax.ejb....
javax.ejb.Local.class javax.ejb.LocalBean.class javax.ejb.LocalHome.class javax.ejb.Lock.class javax.ejb.LockType.class javax.ejb.MessageDriven.class javax.ejb.MessageDrivenBean.class javax.ejb....
javax.ejb.Local.class javax.ejb.LocalBean.class javax.ejb.LocalHome.class javax.ejb.Lock.class javax.ejb.LockType.class javax.ejb.MessageDriven.class javax.ejb.MessageDrivenBean.class javax.ejb....
为了满足架构的目标,规范中描述了 服务器 (Server) 容器 (Container) 类 (Class) 和实例 (Instance) Home 和 Remote 接口 客户端 (Client)
实战EJB 实战EJB 实战EJB 电子书 pdf
EJB方面EJB方面EJB方面EJB方面EJB方面
EJB集群资料EJB集群资料EJB集群资料EJB集群资料
Eclipse 的插件 用于实现在eclipse右键一个java文件的时候,自动完成EJB的HOME,remote,EJBHandler
然后可以将生成的文件target/ejb-remote-server.jar部署到正在运行的Wildfly服务器(例如,通过管理控制台)。 maven中的install命令还将在本地maven存储库中安装该软件包,因此EJB客户端可以找到EJB的远
java反射与EJBjava反射与EJBjava反射与EJBjava反射与EJBjava反射与EJBjava反射与EJB
ejb-3_0-fr-spec-ejbcore.pdf ejb-3_0-fr-spec-persistence.pdf ejb-3_0-fr-spec-simplified.pdf
ejb3中文版
ejb+hibernate资料 ejb+hibernate资料 ejb+hibernate资料 ejb+hibernate资料
手动部署EJB 亲自体验EJB开发流程 手动部署EJB 亲自体验EJB开发流程
Java EJB简单例子,这是HelloWorldBean的Home接口,它是EJB对象的生成库,无状态会话(将在下一个实例中具体讲解)Bean,这个接口是客户端与EJB对象相互作用的中间途径,通过Client触发调用Bean方法: try { //...
EJB3.0规范 EJB3.0 SPECIFICATION 官方规范英文版