1 25 26 package org.objectweb.jonas_ejb.container; 27 28 import java.io.IOException ; 29 import java.io.ObjectInputStream ; 30 import java.io.ObjectOutputStream ; 31 32 import javax.ejb.EJBHome ; 33 import javax.ejb.EJBObject ; 34 import javax.ejb.spi.HandleDelegate ; 35 import javax.rmi.PortableRemoteObject ; 36 37 import org.objectweb.carol.rmi.util.RmiMultiUtility; 38 import org.objectweb.util.monolog.api.BasicLevel; 39 40 44 public class JHandleDelegate implements HandleDelegate { 45 46 50 60 public void writeEJBObject(EJBObject ejb, ObjectOutputStream out) throws IOException { 61 if (TraceEjb.isDebugIc()) { 62 TraceEjb.interp.log(BasicLevel.DEBUG, ""); 63 } 64 out.writeObject(ejb); 65 } 66 67 83 public EJBObject readEJBObject(ObjectInputStream in) throws IOException , ClassNotFoundException { 84 if (TraceEjb.isDebugIc()) { 85 TraceEjb.interp.log(BasicLevel.DEBUG, ""); 86 } 87 Object ejb = in.readObject(); 88 RmiMultiUtility.reconnectStub2Orb(ejb); 89 return (EJBObject ) PortableRemoteObject.narrow(ejb, EJBObject .class); 90 } 91 92 102 public void writeEJBHome(EJBHome home, ObjectOutputStream out) throws IOException { 103 if (TraceEjb.isDebugIc()) { 104 TraceEjb.interp.log(BasicLevel.DEBUG, ""); 105 } 106 out.writeObject(home); 107 } 108 109 125 public EJBHome readEJBHome(ObjectInputStream in) throws IOException , ClassNotFoundException { 126 if (TraceEjb.isDebugIc()) { 127 TraceEjb.interp.log(BasicLevel.DEBUG, ""); 128 } 129 Object home = in.readObject(); 130 RmiMultiUtility.reconnectStub2Orb(home); 131 return (EJBHome ) PortableRemoteObject.narrow(home, EJBHome .class); 132 } 133 } | Popular Tags |