1 23 24 package com.sun.ejb.portable; 25 26 import java.io.*; 27 import java.rmi.RemoteException ; 28 29 import javax.ejb.*; 30 import javax.ejb.spi.HandleDelegate ; 31 import javax.naming.NamingException ; 32 33 34 42 43 public final class HandleImpl implements Handle, Serializable 44 { 45 private EJBObject ejbObject; 46 47 public HandleImpl(EJBObject ejbObject) 49 { 50 this.ejbObject = ejbObject; 51 } 52 53 public EJBObject getEJBObject() throws RemoteException 55 { 56 return ejbObject; 57 } 58 59 private void writeObject(ObjectOutputStream ostream) 60 throws IOException 61 { 62 HandleDelegate handleDelegate; 63 try { 64 handleDelegate = HandleDelegateUtil.getHandleDelegate(); 65 } catch ( NamingException ne ) { 66 throw new EJBException("Unable to lookup HandleDelegate", ne); 67 } 68 handleDelegate.writeEJBObject(ejbObject, ostream); 69 } 70 71 private void readObject(ObjectInputStream istream) 72 throws IOException, ClassNotFoundException 73 { 74 HandleDelegate handleDelegate; 75 try { 76 handleDelegate = HandleDelegateUtil.getHandleDelegate(); 77 } catch ( NamingException ne ) { 78 throw new EJBException("Unable to lookup HandleDelegate", ne); 79 } 80 ejbObject = handleDelegate.readEJBObject(istream); 81 } 82 } 83 | Popular Tags |