1 7 8 11 package com.sun.corba.se.spi.servicecontext; 12 13 import org.omg.IOP.RMICustomMaxStreamFormat ; 14 import javax.rmi.CORBA.*; 15 import org.omg.CORBA.SystemException ; 16 import org.omg.CORBA_2_3.portable.InputStream ; 17 import org.omg.CORBA_2_3.portable.OutputStream ; 18 import com.sun.corba.se.spi.ior.iiop.GIOPVersion; 19 import com.sun.corba.se.impl.encoding.MarshalInputStream; 20 import com.sun.corba.se.impl.encoding.MarshalOutputStream; 21 import com.sun.corba.se.impl.orbutil.ORBUtility; 22 23 public class MaxStreamFormatVersionServiceContext extends ServiceContext { 24 25 private byte maxStreamFormatVersion; 26 27 public static final MaxStreamFormatVersionServiceContext singleton 30 = new MaxStreamFormatVersionServiceContext(); 31 32 public MaxStreamFormatVersionServiceContext() { 33 maxStreamFormatVersion = ORBUtility.getMaxStreamFormatVersion(); 34 } 35 36 public MaxStreamFormatVersionServiceContext(byte maxStreamFormatVersion) { 37 this.maxStreamFormatVersion = maxStreamFormatVersion; 38 } 39 40 public MaxStreamFormatVersionServiceContext(InputStream is, 41 GIOPVersion gv) { 42 super(is, gv) ; 43 44 maxStreamFormatVersion = is.read_octet(); 45 } 46 47 public static final int SERVICE_CONTEXT_ID = RMICustomMaxStreamFormat.value; 48 public int getId() { return SERVICE_CONTEXT_ID; } 49 50 public void writeData(OutputStream os) throws SystemException 51 { 52 os.write_octet(maxStreamFormatVersion); 53 } 54 55 public byte getMaximumStreamFormatVersion() 56 { 57 return maxStreamFormatVersion; 58 } 59 60 public String toString() 61 { 62 return "MaxStreamFormatVersionServiceContext[" 63 + maxStreamFormatVersion + "]"; 64 } 65 } 66 67 68 69 70 | Popular Tags |