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.*; 32 33 34 41 42 public final class HomeHandleImpl implements HomeHandle, Serializable 43 { 44 private EJBHome ejbHome; 45 46 public HomeHandleImpl(EJBHome ejbHome) 48 { 49 this.ejbHome = ejbHome; 50 } 51 52 public EJBHome getEJBHome() throws RemoteException 54 { 55 return ejbHome; 56 } 57 58 private void writeObject(ObjectOutputStream ostream) 59 throws IOException 60 { 61 HandleDelegate handleDelegate; 62 try { 63 handleDelegate = HandleDelegateUtil.getHandleDelegate(); 64 } catch ( NamingException ne ) { 65 throw new EJBException("Unable to lookup HandleDelegate", ne); 66 } 67 handleDelegate.writeEJBHome(ejbHome, ostream); 68 } 69 70 private void readObject(ObjectInputStream istream) 71 throws IOException, ClassNotFoundException 72 { 73 HandleDelegate handleDelegate; 74 try { 75 handleDelegate = HandleDelegateUtil.getHandleDelegate(); 76 } catch ( NamingException ne ) { 77 throw new EJBException("Unable to lookup HandleDelegate", ne); 78 } 79 ejbHome = handleDelegate.readEJBHome(istream); 80 } 81 } 82 | Popular Tags |