44 Chapter 2 integer as a parameter, and (Web site hosting)

44 Chapter 2 integer as a parameter, and another EJB object might take a string instead. The container needs to know this information to generate home objects. You provide this information to the container by specifying a home interface. Home interfaces simply define methods for creating, destroying, and finding EJB objects. The container s home object implements your home interface (see Figure 2.6). As usual, EJB defines some required methods that all home interfaces must support. These required methods are defined in the javax.ejb.EJBHome interface an interface that your home interfaces must extend. Source 2.3 shows javax.ejb.EJBHome. You will learn about these methods later. public interface javax.ejb.EJBHome extends java.rmi.Remote { public EJBMetaData getEJBMetaData() throws java.rmi.RemoteException; public javax.ejb.HomeHandle getHomeHandle() throws java.rmi.RemoteException; public void remove(javax.ejb.Handle handle) throws java.rmi.RemoteException, javax.ejb.RemoveException; public void remove(Object primaryKey) throws java.rmi.RemoteException, javax.ejb.RemoveException; } Source 2.3 A preview of the javax.ejb.EJBHome interface. Notice that the parent javax.ejb.EJBHome derives from java.rmi.Remote. This means your home interfaces do as well, implying that home objects are also fully networked Java RMI remote objects, which can be called across virtual machines. The types of parameters passed in the home interface s methods must be valid types for Java RMI-IIOP. The Local Interfaces One problem with the home interface is that creating beans through that interface is very slow. The same is true for calling beans through the remote interface. Just to give you an idea of what happens when you call an EJB object, the following steps may occur:
Pay us little and get a lot! We will give you the cheapest web hosting available, trust us and check cheapest web hosting services.

Leave a Reply