1 7 8 package com.sun.corba.se.spi.servicecontext; 9 10 import org.omg.CORBA.SystemException ; 11 import org.omg.CORBA_2_3.portable.InputStream ; 12 import org.omg.CORBA_2_3.portable.OutputStream ; 13 14 import com.sun.corba.se.spi.orb.ORBVersion ; 15 import com.sun.corba.se.spi.orb.ORBVersionFactory ; 16 17 import com.sun.corba.se.spi.ior.iiop.GIOPVersion; 18 import com.sun.corba.se.spi.servicecontext.ServiceContext ; 19 import com.sun.corba.se.impl.orbutil.ORBConstants ; 20 21 public class ORBVersionServiceContext extends ServiceContext { 22 23 public ORBVersionServiceContext( ) 24 { 25 version = ORBVersionFactory.getORBVersion() ; 26 } 27 28 public ORBVersionServiceContext( ORBVersion ver ) 29 { 30 this.version = ver ; 31 } 32 33 public ORBVersionServiceContext(InputStream is, GIOPVersion gv) 34 { 35 super(is, gv) ; 36 41 version = ORBVersionFactory.create( in ) ; 42 } 43 44 public static final int SERVICE_CONTEXT_ID = ORBConstants.TAG_ORB_VERSION ; 46 public int getId() { return SERVICE_CONTEXT_ID ; } 47 48 public void writeData( OutputStream os ) throws SystemException 49 { 50 version.write( os ) ; 51 } 52 53 public ORBVersion getVersion() 54 { 55 return version ; 56 } 57 58 private ORBVersion version = ORBVersionFactory.getORBVersion() ; 60 61 public String toString() 62 { 63 return "ORBVersionServiceContext[ version=" + version + " ]" ; 64 } 65 } 66 | Popular Tags |