1 7 8 13 14 22 23 package org.omg.CORBA; 24 25 abstract public class ObjectHelper 26 { 27 private static String _id = ""; 28 29 public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.Object that) 30 { 31 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 32 a.type (type ()); 33 write (out, that); 34 a.read_value (out.create_input_stream (), type ()); 35 } 36 37 public static org.omg.CORBA.Object extract (org.omg.CORBA.Any a) 38 { 39 return read (a.create_input_stream ()); 40 } 41 42 private static org.omg.CORBA.TypeCode __typeCode = null; 43 synchronized public static org.omg.CORBA.TypeCode type () 44 { 45 if (__typeCode == null) 46 { 47 __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (TCKind.tk_objref); 48 } 49 return __typeCode; 50 } 51 52 public static String id () 53 { 54 return _id; 55 } 56 57 public static org.omg.CORBA.Object read (org.omg.CORBA.portable.InputStream istream) 58 { 59 return istream.read_Object (); 60 } 61 62 public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.Object value) 63 { 64 ostream.write_Object (value); 65 } 66 67 } 68 | Popular Tags |