1. /*
  2. * @(#)_IDLTypeStub.java 1.12 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package org.omg.CORBA;
  8. /**
  9. * The Stub for <tt>IDLType</tt>. For more information on
  10. * Stub files, see <a href="doc-files/generatedfiles.html#stub">
  11. * "Generated Files: Stubs"</a>.<P>
  12. * org/omg/CORBA/_IDLTypeStub.java
  13. * Generated by the IDL-to-Java compiler (portable), version "3.0"
  14. * from ir.idl.
  15. * 03 June 1999 11:33:44 o'clock GMT+00:00
  16. */
  17. public class _IDLTypeStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CORBA.IDLType
  18. {
  19. /**
  20. * Constructs a default <code>_IDLTypeStub</code> object.
  21. * NOTE: If the default constructor is used, the
  22. * object is useless until the method <code>_set_delegate</code>
  23. * has been called.
  24. */
  25. // NOTE: This constructor is not required according to the spec. Only JCK expects it now.
  26. public _IDLTypeStub ()
  27. {
  28. super ();
  29. }
  30. /**
  31. * Constructs an <code>_IDLTypeStub</code> object initialized
  32. * with the given <code>Delegate</code> object.
  33. *
  34. * @param delegate a Delegate object
  35. */
  36. // NOTE: This constructor is not required according to the spec. We keep it as a convenience method.
  37. public _IDLTypeStub (org.omg.CORBA.portable.Delegate delegate)
  38. {
  39. super ();
  40. _set_delegate (delegate);
  41. }
  42. public org.omg.CORBA.TypeCode type ()
  43. {
  44. org.omg.CORBA.portable.InputStream _in = null;
  45. try {
  46. org.omg.CORBA.portable.OutputStream _out = _request ("_get_type", true);
  47. _in = _invoke (_out);
  48. org.omg.CORBA.TypeCode __result = _in.read_TypeCode ();
  49. return __result;
  50. } catch (org.omg.CORBA.portable.ApplicationException _ex) {
  51. _in = _ex.getInputStream ();
  52. String _id = _ex.getId ();
  53. throw new org.omg.CORBA.MARSHAL (_id);
  54. } catch (org.omg.CORBA.portable.RemarshalException _rm) {
  55. return type ();
  56. } finally {
  57. _releaseReply (_in);
  58. }
  59. } // type
  60. // read interface
  61. public org.omg.CORBA.DefinitionKind def_kind ()
  62. {
  63. org.omg.CORBA.portable.InputStream _in = null;
  64. try {
  65. org.omg.CORBA.portable.OutputStream _out = _request ("_get_def_kind", true);
  66. _in = _invoke (_out);
  67. org.omg.CORBA.DefinitionKind __result = org.omg.CORBA.DefinitionKindHelper.read (_in);
  68. return __result;
  69. } catch (org.omg.CORBA.portable.ApplicationException _ex) {
  70. _in = _ex.getInputStream ();
  71. String _id = _ex.getId ();
  72. throw new org.omg.CORBA.MARSHAL (_id);
  73. } catch (org.omg.CORBA.portable.RemarshalException _rm) {
  74. return def_kind ();
  75. } finally {
  76. _releaseReply (_in);
  77. }
  78. } // def_kind
  79. // write interface
  80. public void destroy ()
  81. {
  82. org.omg.CORBA.portable.InputStream _in = null;
  83. try {
  84. org.omg.CORBA.portable.OutputStream _out = _request ("destroy", true);
  85. _in = _invoke (_out);
  86. } catch (org.omg.CORBA.portable.ApplicationException _ex) {
  87. _in = _ex.getInputStream ();
  88. String _id = _ex.getId ();
  89. throw new org.omg.CORBA.MARSHAL (_id);
  90. } catch (org.omg.CORBA.portable.RemarshalException _rm) {
  91. destroy ();
  92. } finally {
  93. _releaseReply (_in);
  94. }
  95. } // destroy
  96. // Type-specific CORBA::Object operations
  97. private static String[] __ids = {
  98. "IDL:omg.org/CORBA/IDLType:1.0",
  99. "IDL:omg.org/CORBA/IRObject:1.0"};
  100. public String[] _ids ()
  101. {
  102. return (String[])__ids.clone ();
  103. }
  104. private void readObject (java.io.ObjectInputStream s)
  105. {
  106. try
  107. {
  108. String str = s.readUTF ();
  109. org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init ().string_to_object (str);
  110. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
  111. _set_delegate (delegate);
  112. } catch (java.io.IOException e) {}
  113. }
  114. private void writeObject (java.io.ObjectOutputStream s)
  115. {
  116. try
  117. {
  118. String str = org.omg.CORBA.ORB.init ().object_to_string (this);
  119. s.writeUTF (str);
  120. } catch (java.io.IOException e) {}
  121. }
  122. } // class _IDLTypeStub