KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > CORBA > _IDLTypeStub


1 /*
2  * @(#)_IDLTypeStub.java 1.13 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package org.omg.CORBA;
8
9
10 /**
11 * The Stub for <tt>IDLType</tt>. For more information on
12 * Stub files, see <a HREF="doc-files/generatedfiles.html#stub">
13 * "Generated Files: Stubs"</a>.<P>
14 * org/omg/CORBA/_IDLTypeStub.java
15 * Generated by the IDL-to-Java compiler (portable), version "3.0"
16 * from ir.idl.
17 * 03 June 1999 11:33:44 o'clock GMT+00:00
18 */

19
20 public class _IDLTypeStub extends org.omg.CORBA.portable.ObjectImpl JavaDoc implements org.omg.CORBA.IDLType JavaDoc
21 {
22   /**
23    * Constructs a default <code>_IDLTypeStub</code> object.
24    * NOTE: If the default constructor is used, the
25    * object is useless until the method <code>_set_delegate</code>
26    * has been called.
27    */

28   // NOTE: This constructor is not required according to the spec. Only JCK expects it now.
29
public _IDLTypeStub ()
30   {
31     super ();
32   }
33
34   /**
35    * Constructs an <code>_IDLTypeStub</code> object initialized
36    * with the given <code>Delegate</code> object.
37    *
38    * @param delegate a Delegate object
39    */

40   // NOTE: This constructor is not required according to the spec. We keep it as a convenience method.
41
public _IDLTypeStub (org.omg.CORBA.portable.Delegate JavaDoc delegate)
42   {
43     super ();
44     _set_delegate (delegate);
45   }
46
47   public org.omg.CORBA.TypeCode JavaDoc type ()
48   {
49     org.omg.CORBA.portable.InputStream JavaDoc _in = null;
50     try {
51        org.omg.CORBA.portable.OutputStream JavaDoc _out = _request ("_get_type", true);
52        _in = _invoke (_out);
53        org.omg.CORBA.TypeCode JavaDoc __result = _in.read_TypeCode ();
54        return __result;
55     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc _ex) {
56        _in = _ex.getInputStream ();
57        String JavaDoc _id = _ex.getId ();
58        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
59     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc _rm) {
60        return type ();
61     } finally {
62         _releaseReply (_in);
63     }
64   } // type
65

66
67   // read interface
68
public org.omg.CORBA.DefinitionKind JavaDoc def_kind ()
69   {
70     org.omg.CORBA.portable.InputStream JavaDoc _in = null;
71     try {
72        org.omg.CORBA.portable.OutputStream JavaDoc _out = _request ("_get_def_kind", true);
73        _in = _invoke (_out);
74        org.omg.CORBA.DefinitionKind JavaDoc __result = org.omg.CORBA.DefinitionKindHelper.read (_in);
75        return __result;
76     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc _ex) {
77        _in = _ex.getInputStream ();
78        String JavaDoc _id = _ex.getId ();
79        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
80     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc _rm) {
81        return def_kind ();
82     } finally {
83         _releaseReply (_in);
84     }
85   } // def_kind
86

87
88   // write interface
89
public void destroy ()
90   {
91     org.omg.CORBA.portable.InputStream JavaDoc _in = null;
92     try {
93        org.omg.CORBA.portable.OutputStream JavaDoc _out = _request ("destroy", true);
94        _in = _invoke (_out);
95     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc _ex) {
96        _in = _ex.getInputStream ();
97        String JavaDoc _id = _ex.getId ();
98        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
99     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc _rm) {
100        destroy ();
101     } finally {
102         _releaseReply (_in);
103     }
104   } // destroy
105

106   // Type-specific CORBA::Object operations
107
private static String JavaDoc[] __ids = {
108     "IDL:omg.org/CORBA/IDLType:1.0",
109     "IDL:omg.org/CORBA/IRObject:1.0"};
110
111   public String JavaDoc[] _ids ()
112   {
113     return (String JavaDoc[])__ids.clone ();
114   }
115
116   private void readObject (java.io.ObjectInputStream JavaDoc s)
117   {
118      try
119      {
120        String JavaDoc str = s.readUTF ();
121        org.omg.CORBA.Object JavaDoc obj = org.omg.CORBA.ORB.init ().string_to_object (str);
122        org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc) obj)._get_delegate ();
123        _set_delegate (delegate);
124      } catch (java.io.IOException JavaDoc e) {}
125   }
126
127   private void writeObject (java.io.ObjectOutputStream JavaDoc s)
128   {
129      try
130      {
131        String JavaDoc str = org.omg.CORBA.ORB.init ().object_to_string (this);
132        s.writeUTF (str);
133      } catch (java.io.IOException JavaDoc e) {}
134   }
135 } // class _IDLTypeStub
136
Popular Tags