1. /*
  2. * @(#)PolicyTypeHelper.java 1.4 00/02/02
  3. *
  4. * Copyright 1999, 2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package org.omg.CORBA;
  11. /**
  12. * org/omg/CORBA/PolicyTypeHelper.java
  13. * Generated by the IDL-to-Java compiler (portable), version "3.0"
  14. * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl
  15. * Saturday, July 17, 1999 12:26:20 AM PDT
  16. */
  17. // basic Policy definition
  18. abstract public class PolicyTypeHelper
  19. {
  20. private static String _id = "IDL:omg.org/CORBA/PolicyType:1.0";
  21. public static void insert (org.omg.CORBA.Any a, int that)
  22. {
  23. org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  24. a.type (type ());
  25. write (out, that);
  26. a.read_value (out.create_input_stream (), type ());
  27. }
  28. public static int extract (org.omg.CORBA.Any a)
  29. {
  30. return read (a.create_input_stream ());
  31. }
  32. private static org.omg.CORBA.TypeCode __typeCode = null;
  33. synchronized public static org.omg.CORBA.TypeCode type ()
  34. {
  35. if (__typeCode == null)
  36. {
  37. __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong);
  38. __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.PolicyTypeHelper.id (), "PolicyType", __typeCode);
  39. }
  40. return __typeCode;
  41. }
  42. public static String id ()
  43. {
  44. return _id;
  45. }
  46. public static int read (org.omg.CORBA.portable.InputStream istream)
  47. {
  48. int value = (int)0;
  49. value = istream.read_ulong ();
  50. return value;
  51. }
  52. public static void write (org.omg.CORBA.portable.OutputStream ostream, int value)
  53. {
  54. ostream.write_ulong (value);
  55. }
  56. }