ejbgetter.java~4~
来自「一个java」· JAVA~4~ 代码 · 共 30 行
JAVA~4~
30 行
package bookstore;import javax.rmi.PortableRemoteObject;import javax.naming.InitialContext;import javax.naming.NamingException;/*** This helper class fetches EJB home references.*/public final class EJBGetter { public static CustomerHome getCutomerHome() throws NamingException { InitialContext initial = new InitialContext(); Object objref = initial.lookup("Customer"); return (CustomerHome) PortableRemoteObject.narrow(objref, CustomerHome.class); }//getCustomerHome public static CustomerControllerHome getCustomerControllerHome() throws NamingException { InitialContext initial = new InitialContext(); Object objref = initial.lookup("CustomerController"); return (CustomerControllerHome) PortableRemoteObject.narrow(objref, CustomerControllerHome.class); }//getCustomerControllerHome } // EJBGetter
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?