1. package com.sun.corba.se.PortableActivationIDL;
  2. /**
  3. * com/sun/corba/se/PortableActivationIDL/TCPPortHelper.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.2"
  5. * from ../../../../src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl
  6. * Wednesday, September 15, 2004 3:50:44 AM PDT
  7. */
  8. /** Type of TCP port number, used in structures that describe
  9. * transport endpoints. The valid range is actually 0-65535, but
  10. * we use a long here to avoid signed/unsigned conversion headaches
  11. * in Java.
  12. */
  13. abstract public class TCPPortHelper
  14. {
  15. private static String _id = "IDL:PortableActivationIDL/TCPPort:1.0";
  16. public static void insert (org.omg.CORBA.Any a, int that)
  17. {
  18. org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  19. a.type (type ());
  20. write (out, that);
  21. a.read_value (out.create_input_stream (), type ());
  22. }
  23. public static int extract (org.omg.CORBA.Any a)
  24. {
  25. return read (a.create_input_stream ());
  26. }
  27. private static org.omg.CORBA.TypeCode __typeCode = null;
  28. synchronized public static org.omg.CORBA.TypeCode type ()
  29. {
  30. if (__typeCode == null)
  31. {
  32. __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_long);
  33. __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.corba.se.PortableActivationIDL.TCPPortHelper.id (), "TCPPort", __typeCode);
  34. }
  35. return __typeCode;
  36. }
  37. public static String id ()
  38. {
  39. return _id;
  40. }
  41. public static int read (org.omg.CORBA.portable.InputStream istream)
  42. {
  43. int value = (int)0;
  44. value = istream.read_long ();
  45. return value;
  46. }
  47. public static void write (org.omg.CORBA.portable.OutputStream ostream, int value)
  48. {
  49. ostream.write_long (value);
  50. }
  51. }