📄 ejbgetter.java~4~
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -