1. package org.omg.CORBA;
  2. /**
  3. * org/omg/CORBA/PolicyErrorCodeHelper.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.2"
  5. * from ../../../../src/share/classes/org/omg/PortableInterceptor/CORBAX.idl
  6. * Wednesday, September 15, 2004 10:28:43 AM GMT
  7. */
  8. /**
  9. * Encapsulates a reason a Policy may be invalid.
  10. *
  11. * @see PolicyError
  12. */
  13. abstract public class PolicyErrorCodeHelper
  14. {
  15. private static String _id = "IDL:omg.org/CORBA/PolicyErrorCode:1.0";
  16. public static void insert (org.omg.CORBA.Any a, short 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 short 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_short);
  33. __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.PolicyErrorCodeHelper.id (), "PolicyErrorCode", __typeCode);
  34. }
  35. return __typeCode;
  36. }
  37. public static String id ()
  38. {
  39. return _id;
  40. }
  41. public static short read (org.omg.CORBA.portable.InputStream istream)
  42. {
  43. short value = (short)0;
  44. value = istream.read_short ();
  45. return value;
  46. }
  47. public static void write (org.omg.CORBA.portable.OutputStream ostream, short value)
  48. {
  49. ostream.write_short (value);
  50. }
  51. }