Exceptions

   

The javax.ejb.spi Package

The 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 .

HandleDelegate

The 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

Return Type

Method Name

EJBHome

readEJBHome

EJBObject

readEJBObject

void

writeEJBHome

void

writeEJBObject

readEJBHome

Deserialize 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, graphics/ccc.gif ClassNotFoundException; 
readEJBObject

Deserialize 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, graphics/ccc.gif ClassNotFoundException; 
writeEJBHome

Serialize 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; 
writeEJBObject

Serialize 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; 


Special Edition Using Enterprise JavaBeans 2.0
Special Edition Using Enterprise JavaBeans 2.0
ISBN: 0789725673
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net