⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ejbgetter.java~8~

📁 一个java
💻 JAVA~8~
字号:
package bookstore.util;import bookstore.ejb.*;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 getCustomerHome() 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  public static CommentHome getCommentHome() throws NamingException  {      InitialContext initial = new InitialContext();      Object objref = initial.lookup("Comment");      return (CommentHome)          PortableRemoteObject.narrow(objref, CommentHome.class);  }//getCommentHome  public static CommentControllerHome getCommentControllerHome()      throws NamingException  {      InitialContext initial = new InitialContext();      Object objref = initial.lookup("CommentController");      return (CommentControllerHome)          PortableRemoteObject.narrow(objref, CommentControllerHome.class);  }//getCommentControllerHome  public static ManagerHome getManagerHome() throws NamingException  {      InitialContext initial = new InitialContext();      Object objref = initial.lookup("Manager");      return (ManagerHome)          PortableRemoteObject.narrow(objref, ManagerHome.class);  }//getManagerHome  public static ManagerControllerHome getManagerControllerHome()      throws NamingException  {      InitialContext initial = new InitialContext();      Object objref = initial.lookup("ManagerController");      return (ManagerControllerHome)          PortableRemoteObject.narrow(objref, ManagerControllerHome.class);  }//getManagerControllerHome  public static SupplierHome getSupplierHome() throws NamingException  {      InitialContext initial = new InitialContext();      Object objref = initial.lookup("Supplier");      return (SupplierHome)          PortableRemoteObject.narrow(objref, SupplierHome.class);  }//getSupplierHome  public static SupplierControllerHome getSupplierControllerHome()      throws NamingException  {      InitialContext initial = new InitialContext();      Object objref = initial.lookup("SupplierController");      return (SupplierControllerHome)          PortableRemoteObject.narrow(objref, SupplierControllerHome.class);  }//getSupplierControllerHome  public static BasketHome getBasketHome() throws NamingException  {      InitialContext initial = new InitialContext();      Object objref = initial.lookup("Basket");      return (BasketHome)          PortableRemoteObject.narrow(objref, BasketHome.class);  }//getBasketHome  public static BasketControllerHome getBasketControllerHome()      throws NamingException  {      InitialContext initial = new InitialContext();      Object objref = initial.lookup("BasketController");      return (BasketControllerHome)          PortableRemoteObject.narrow(objref, BasketControllerHome.class);  }//getBasketControllerHome  } // EJBGetter

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -