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