1 7 8 package com.sun.corba.se.spi.orb ; 9 10 import com.sun.corba.se.spi.orb.ORBVersion ; 11 import com.sun.corba.se.impl.orb.ORBVersionImpl ; 12 import org.omg.CORBA.portable.InputStream ; 13 import org.omg.CORBA.INTERNAL ; 14 15 public class ORBVersionFactory { 16 private ORBVersionFactory() {} ; 17 18 public static ORBVersion getFOREIGN() 19 { 20 return ORBVersionImpl.FOREIGN ; 21 } 22 23 public static ORBVersion getOLD() 24 { 25 return ORBVersionImpl.OLD ; 26 } 27 28 public static ORBVersion getNEW() 29 { 30 return ORBVersionImpl.NEW ; 31 } 32 33 public static ORBVersion getJDK1_3_1_01() 34 { 35 return ORBVersionImpl.JDK1_3_1_01 ; 36 } 37 38 public static ORBVersion getNEWER() 39 { 40 return ORBVersionImpl.NEWER ; 41 } 42 43 public static ORBVersion getPEORB() 44 { 45 return ORBVersionImpl.PEORB ; 46 } 47 48 50 public static ORBVersion getORBVersion() 51 { 52 return ORBVersionImpl.PEORB ; 53 } 54 55 public static ORBVersion create( InputStream is ) 56 { 57 byte value = is.read_octet() ; 58 return byteToVersion( value ) ; 59 } 60 61 private static ORBVersion byteToVersion( byte value ) 62 { 63 72 73 84 85 switch (value) { 86 case ORBVersion.FOREIGN : return ORBVersionImpl.FOREIGN ; 87 case ORBVersion.OLD : return ORBVersionImpl.OLD ; 88 case ORBVersion.NEW : return ORBVersionImpl.NEW ; 89 case ORBVersion.JDK1_3_1_01: return ORBVersionImpl.JDK1_3_1_01 ; 90 case ORBVersion.NEWER : return ORBVersionImpl.NEWER ; 91 case ORBVersion.PEORB : return ORBVersionImpl.PEORB ; 92 default : return new ORBVersionImpl(value); 93 } 94 } 95 } 96 | Popular Tags |