Handles

  • can be used to persistently store a reference to bean object or bean's home interface
  • the actual handle class (provided by EJB container provider) must implement the Handle or HomeHandle interface:
    public interface javax.ejb.Handle extends java.io.Serializable {
      public EJBObject getEJBObject() throws java.rmi.RemoteException;
    }
    
    public interface javax.ejb.HomeHandle extends java.io.Serializable {
      public EJBObject getEJBHome() throws java.rmi.RemoteException;
    }
    
  • mention that the handle objects are serializable

Getting the handle: bean's getHandle() method returns a handle object

Getting the remote interface reference from the handle instance: h.getEJBObject()

Getting the home interface reference from the handle instance: h.getEJBHome()

First Previous Next

Slide: 11