1 package CosTime;
2
3
4 /**
* CosTime/TimeServiceHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.1"
* from time.idl
* Freitag, 18. April 2003 11.06 Uhr CEST
*/
5
6 abstract public class TimeServiceHelper
7 {
8 private static String _id = "IDL:hpi.uni-potsdam.de/CosTime/TimeService:1.0";
9
10 public static void insert (org.omg.CORBA.Any a, CosTime.TimeService 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.TimeService 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.TimeServiceHelper.id (), "TimeService");
29 }
30 return __typeCode;
31 }
32
33 public static String id ()
34 {
35 return _id;
36 }
37
38 public static CosTime.TimeService read (org.omg.CORBA.portable.InputStream istream)
39 {
40 return narrow (istream.read_Object (_TimeServiceStub.class));
41 }
42
43 public static void write (org.omg.CORBA.portable.OutputStream ostream, CosTime.TimeService value)
44 {
45 ostream.write_Object ((org.omg.CORBA.Object) value);
46 }
47
48 public static CosTime.TimeService narrow (org.omg.CORBA.Object obj)
49 {
50 if (obj == null)
51 return null;
52 else if (obj instanceof CosTime.TimeService)
53 return (CosTime.TimeService)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._TimeServiceStub stub = new CosTime._TimeServiceStub ();
60 stub._set_delegate(delegate);
61 return stub;
62 }
63 }
64
65 }
66