studies/corba/Corba-Code1/client/CosTime/UTOHelper.java
⇒
download file
1 package CosTime;
2
3
4
5
6 abstract public class UTOHelper
7 {
8 private static String _id = "IDL:hpi.uni-potsdam.de/CosTime/UTO:1.0";
9
10 public static void insert (org.omg.CORBA.Any a, CosTime.UTO that)
11 {
12 org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
13 a.type (type ());
14 write (out, that);
15 a.read_value (out.create_input_stream (), type ());
16 }
17
18 public static CosTime.UTO extract (org.omg.CORBA.Any a)
19 {
20 return read (a.create_input_stream ());
21 }
22
23 private static org.omg.CORBA.TypeCode __typeCode = null;
24 synchronized public static org.omg.CORBA.TypeCode type ()
25 {
26 if (__typeCode == null)
27 {
28 __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (CosTime.UTOHelper.id (), "UTO");
29 }
30 return __typeCode;
31 }
32
33 public static String id ()
34 {
35 return _id;
36 }
37
38 public static CosTime.UTO read (org.omg.CORBA.portable.InputStream istream)
39 {
40 return narrow (istream.read_Object (_UTOStub.class));
41 }
42
43 public static void write (org.omg.CORBA.portable.OutputStream ostream, CosTime.UTO value)
44 {
45 ostream.write_Object ((org.omg.CORBA.Object) value);
46 }
47
48 public static CosTime.UTO narrow (org.omg.CORBA.Object obj)
49 {
50 if (obj == null)
51 return null;
52 else if (obj instanceof CosTime.UTO)
53 return (CosTime.UTO)obj;
54 else if (!obj._is_a (id ()))
55 throw new org.omg.CORBA.BAD_PARAM ();
56 else
57 {
58 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
59 CosTime._UTOStub stub = new CosTime._UTOStub ();
60 stub._set_delegate(delegate);
61 return stub;
62 }
63 }
64
65 }
66