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 private static String _id = "IDL:hpi.uni-potsdam.de/CosTime/TimeService:1.0";
8
9 public static void insert (org.omg.CORBA.Any a, CosTime.TimeService 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.TimeService 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.TimeServiceHelper.id (), "TimeService");
28 }
29 return __typeCode;
30 }
31
32 public static String id ()
33 {
34 return _id;
35 }
36
37 public static CosTime.TimeService read (org.omg.CORBA.portable.InputStream istream)
38 {
39 return narrow (istream.read_Object (_TimeServiceStub.class));
40 }
41
42 public static void write (org.omg.CORBA.portable.OutputStream ostream, CosTime.TimeService value)
43 {
44 ostream.write_Object ((org.omg.CORBA.Object) value);
45 }
46
47 public static CosTime.TimeService narrow (org.omg.CORBA.Object obj)
48 {
49 if (obj == null)
50 return null;
51 else if (obj instanceof CosTime.TimeService)
52 return (CosTime.TimeService)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._TimeServiceStub stub = new CosTime._TimeServiceStub ();
58 stub._set_delegate(delegate);
59 return stub;
60 }
61 }
62
63 }
64
65