异常 /The code is used to create the remote interface of an enterprise bean //used by the HelloApp application import javax. ejb. * i import java rmi k public interface Hello extends EJBObject String sayHello(String My Name)throws Remote Exception; sayHello方法抛出 Remote Exception异常 RemoteException异常是 ava.rm包的一部分 n当在客户端与服务器交互的过程中出现网络错误时会产生此异常 网络异常在任何时候都由可能发生,因此每个方法都必须抛出 Remote Exception异常,另外商业方法还可以抛出其它的异常
//The code is used to create the remote interface of an enterprise bean //used by the HelloApp application import javax.ejb.*; import java.rmi.*; public interface Hello extends EJBObject { String sayHello(String MyName) throws RemoteException; } 异常 ◼ sayHello方法抛出RemoteException异常 ◼ RemoteException异常是java.rmi包的一部分 ◼ 当在客户端与服务器交互的过程中出现网络错误时会产生此异常 ◼ 网络异常在任何时候都由可能发生,因此每个方法都必须抛出 RemoteException异常,另外商业方法还可以抛出其它的异常
Create Home Interface
Create Home Interface
Home接口 Home [nter£acE Home Interface Home Interface包含 enterprise bean生命周期管理的相关方法 客户程序使用 Home Interface创建、查找或删除 enterprise bean的实例
Home接口 ◼ Home Interface ◼ Home Interface包含enterprise bean生命周期管理的相关方法 ◼ 客户程序使用Home Interface创建、查找或删除 enterprise bean的实例
相关角色 EJB Container Enterprise Bean Home接口由 Enterprise Bean Provider编写 EJB容器生成home接口的实现
相关角色 ◼ Home接口由Enterprise Bean Provider编写 ◼ EJB容器生成home接口的实现