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