1 7 8 package com.sun.corba.se.impl.copyobject ; 9 10 import java.util.logging.Level ; 11 import java.util.logging.Logger ; 12 13 import java.io.Serializable ; 14 import java.rmi.Remote ; 15 import java.rmi.MarshalException ; 16 17 import org.omg.CORBA_2_3.portable.InputStream ; 18 import org.omg.CORBA_2_3.portable.OutputStream ; 19 import org.omg.CORBA.ORB ; 20 21 import com.sun.corba.se.spi.copyobject.ObjectCopier ; 22 import com.sun.corba.se.impl.util.Utility; 23 24 public class ORBStreamObjectCopierImpl implements ObjectCopier { 25 26 public ORBStreamObjectCopierImpl( ORB orb ) 27 { 28 this.orb = orb ; 29 } 30 31 public Object copy(Object obj) { 32 if (obj instanceof Remote ) { 33 return Utility.autoConnect(obj,orb,true); 36 } 37 38 OutputStream out = (OutputStream )orb.create_output_stream(); 39 out.write_value((Serializable )obj); 40 InputStream in = (InputStream )out.create_input_stream(); 41 return in.read_value(); 42 } 43 44 private ORB orb; 45 } 46 | Popular Tags |