1 package org.omg.CosNaming; 2 3 4 10 11 12 21 abstract public class NamingContextHelper 22 { 23 private static String _id = "IDL:omg.org/CosNaming/NamingContext:1.0"; 24 25 public static void insert (org.omg.CORBA.Any a, org.omg.CosNaming.NamingContext that) 26 { 27 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 28 a.type (type ()); 29 write (out, that); 30 a.read_value (out.create_input_stream (), type ()); 31 } 32 33 public static org.omg.CosNaming.NamingContext extract (org.omg.CORBA.Any a) 34 { 35 return read (a.create_input_stream ()); 36 } 37 38 private static org.omg.CORBA.TypeCode __typeCode = null; 39 synchronized public static org.omg.CORBA.TypeCode type () 40 { 41 if (__typeCode == null) 42 { 43 __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.CosNaming.NamingContextHelper.id (), "NamingContext"); 44 } 45 return __typeCode; 46 } 47 48 public static String id () 49 { 50 return _id; 51 } 52 53 public static org.omg.CosNaming.NamingContext read (org.omg.CORBA.portable.InputStream istream) 54 { 55 return narrow (istream.read_Object (_NamingContextStub .class)); 56 } 57 58 public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CosNaming.NamingContext value) 59 { 60 ostream.write_Object ((org.omg.CORBA.Object ) value); 61 } 62 63 public static org.omg.CosNaming.NamingContext narrow (org.omg.CORBA.Object obj) 64 { 65 if (obj == null) 66 return null; 67 else if (obj instanceof org.omg.CosNaming.NamingContext ) 68 return (org.omg.CosNaming.NamingContext )obj; 69 else if (!obj._is_a (id ())) 70 throw new org.omg.CORBA.BAD_PARAM (); 71 else 72 { 73 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl )obj)._get_delegate (); 74 org.omg.CosNaming._NamingContextStub stub = new org.omg.CosNaming._NamingContextStub (); 75 stub._set_delegate(delegate); 76 return stub; 77 } 78 } 79 80 public static org.omg.CosNaming.NamingContext unchecked_narrow (org.omg.CORBA.Object obj) 81 { 82 if (obj == null) 83 return null; 84 else if (obj instanceof org.omg.CosNaming.NamingContext ) 85 return (org.omg.CosNaming.NamingContext )obj; 86 else 87 { 88 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl )obj)._get_delegate (); 89 org.omg.CosNaming._NamingContextStub stub = new org.omg.CosNaming._NamingContextStub (); 90 stub._set_delegate(delegate); 91 return stub; 92 } 93 } 94 95 } 96 | Popular Tags |