1 7 8 package com.sun.corba.se.impl.ior ; 9 10 import java.util.Iterator ; 11 12 import org.omg.CORBA.portable.InputStream ; 13 import org.omg.CORBA.portable.OutputStream ; 14 import org.omg.CORBA.portable.StreamableValue ; 15 16 import org.omg.CORBA.TypeCode ; 17 18 import org.omg.PortableInterceptor.ObjectReferenceFactory ; 19 import org.omg.PortableInterceptor.ObjectReferenceFactoryHelper ; 20 21 import com.sun.corba.se.spi.oa.ObjectAdapter ; 22 23 import com.sun.corba.se.spi.ior.ObjectId ; 24 import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; 25 import com.sun.corba.se.spi.ior.ObjectAdapterId ; 26 import com.sun.corba.se.spi.ior.IOR; 27 import com.sun.corba.se.spi.ior.IORFactory; 28 import com.sun.corba.se.spi.ior.IORTemplateList; 29 import com.sun.corba.se.spi.ior.IORFactories; 30 31 import com.sun.corba.se.impl.orbutil.ORBUtility ; 32 33 import com.sun.corba.se.spi.orb.ORB ; 34 35 43 public class ObjectReferenceFactoryImpl extends ObjectReferenceProducerBase 44 implements ObjectReferenceFactory , StreamableValue 45 { 46 transient private IORTemplateList iorTemplates ; 47 48 public ObjectReferenceFactoryImpl( InputStream is ) 49 { 50 super( (ORB)(is.orb()) ) ; 51 _read( is ) ; 52 } 53 54 public ObjectReferenceFactoryImpl( ORB orb, IORTemplateList iortemps ) 55 { 56 super( orb ) ; 57 iorTemplates = iortemps ; 58 } 59 60 public boolean equals( Object obj ) 61 { 62 if (!(obj instanceof ObjectReferenceFactoryImpl)) 63 return false ; 64 65 ObjectReferenceFactoryImpl other = (ObjectReferenceFactoryImpl)obj ; 66 67 return (iorTemplates != null) && 68 iorTemplates.equals( other.iorTemplates ) ; 69 } 70 71 public int hashCode() 72 { 73 return iorTemplates.hashCode() ; 74 } 75 76 public static final String repositoryId = 82 "IDL:com/sun/corba/se/impl/ior/ObjectReferenceFactoryImpl:1.0" ; 83 84 public String [] _truncatable_ids() 85 { 86 return new String [] { repositoryId } ; 87 } 88 89 public TypeCode _type() 90 { 91 return ObjectReferenceFactoryHelper.type() ; 92 } 93 94 97 public void _read( InputStream is ) 98 { 99 org.omg.CORBA_2_3.portable.InputStream istr = 100 (org.omg.CORBA_2_3.portable.InputStream )is ; 101 102 iorTemplates = IORFactories.makeIORTemplateList( istr ) ; 103 } 104 105 107 public void _write( OutputStream os ) 108 { 109 org.omg.CORBA_2_3.portable.OutputStream ostr = 110 (org.omg.CORBA_2_3.portable.OutputStream )os ; 111 112 iorTemplates.write( ostr ) ; 113 } 114 115 public IORFactory getIORFactory() 116 { 117 return iorTemplates ; 118 } 119 120 public IORTemplateList getIORTemplateList() 121 { 122 return iorTemplates ; 123 } 124 } 125 | Popular Tags |