KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > PortableActivationIDL > TCPPortHelper


1 package com.sun.corba.se.PortableActivationIDL;
2
3
4 /**
5 * com/sun/corba/se/PortableActivationIDL/TCPPortHelper.java .
6 * Generated by the IDL-to-Java compiler (portable), version "3.2"
7 * from ../../../../src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl
8 * Saturday, February 9, 2008 2:04:41 AM PST
9 */

10
11
12 /** Type of TCP port number, used in structures that describe
13     * transport endpoints. The valid range is actually 0-65535, but
14     * we use a long here to avoid signed/unsigned conversion headaches
15     * in Java.
16     */

17 abstract public class TCPPortHelper
18 {
19   private static String JavaDoc _id = "IDL:PortableActivationIDL/TCPPort:1.0";
20
21   public static void insert (org.omg.CORBA.Any JavaDoc a, int that)
22   {
23     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
24     a.type (type ());
25     write (out, that);
26     a.read_value (out.create_input_stream (), type ());
27   }
28
29   public static int extract (org.omg.CORBA.Any JavaDoc a)
30   {
31     return read (a.create_input_stream ());
32   }
33
34   private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
35   synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
36   {
37     if (__typeCode == null)
38     {
39       __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_long);
40       __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.corba.se.PortableActivationIDL.TCPPortHelper.id (), "TCPPort", __typeCode);
41     }
42     return __typeCode;
43   }
44
45   public static String JavaDoc id ()
46   {
47     return _id;
48   }
49
50   public static int read (org.omg.CORBA.portable.InputStream JavaDoc istream)
51   {
52     int value = (int)0;
53     value = istream.read_long ();
54     return value;
55   }
56
57   public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, int value)
58   {
59     ostream.write_long (value);
60   }
61
62 }
63
Popular Tags