The javax.ejb.spi PackageThe javax.ejb.spi package is a brand new package added in the EJB 2.0 Specification. For now, only a single interface is defined there. In the future, however, it's likely that more interfaces and classes will be added to grant more flexibility to the EJB vendors . HandleDelegateThe EJB container provides the implementation for the HandleDelegate interface. It is used by portable implementations of javax.ejb.Handle and javax.ejb.HomeHandle . It is not used by EJB components or by client components . The HandleDelegate interface provides methods to serialize and deserialize EJBObject and EJBHome references to streams. The HandleDelegate object is obtained by JNDI lookup at the reserved name java:comp/ HandleDelegate . Table A.11 lists the methods in the HandleDelegate interface. Table A.11. The Methods of the HandleDelegate Interface
readEJBHomeDeserialize the EJBHome reference corresponding to a HomeHandle . readEJBHome is called from the readObject method of portable HomeHandle implementation classes. The ObjectInputStream object is the same object that was passed in to the HomeHandle class's readObject . When readEJBHome is called, the input stream must point to the location in the stream at which the EJBHome reference can be read. The container must ensure that the EJBHome reference is capable of performing invocations immediately after deserialization. Here is the method signature: public EJBHome readEJBHome(ObjectInputStream str) throws IOException, ClassNotFoundException; readEJBObjectDeserialize the EJBObject reference corresponding to a Handle . The readEJBObject method is called from the readObject method of portable Handle implementation classes. The ObjectInputStream object is the same object that was passed in to the Handle class's readObject . When readEJBObject is called, the input stream must point to the location in the stream at which the EJBObject reference can be read. The container must ensure that the EJBObject reference is capable of performing invocations immediately after deserialization. Here is the method signature: public EJBObject readEJBObject(ObjectInputStream str) throws IOException, ClassNotFoundException; writeEJBHomeSerialize the EJBHome reference corresponding to a HomeHandle . This method is called from the writeObject method of portable HomeHandle implementation classes. The ObjectOutputStream object is the same object that was passed in to the Handle class's writeObject . Here is the method signature: public void writeEJBHome(EJBHome home, ObjectOutputStream str) throws IOException; writeEJBObjectSerialize the EJBObject reference corresponding to a Handle . This method is called from the writeObject method of portable Handle implementation classes. The ObjectOutputStream object is the same object that was passed in to the Handle class's writeObject . Here is the method signature: public void writeEJBObject(EJBObject obj, ObjectOutputStream str) throws IOException; |