KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jts > otsidl > _JControlStub


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
26  * Use is subject to license terms.
27  */

28 package com.sun.jts.otsidl;
29
30
31 /**
32 * com/sun/jts/otsidl/_JControlStub.java .
33 * Generated by the IDL-to-Java compiler (portable), version "3.1"
34 * from com/sun/jts/ots.idl
35 * Tuesday, February 5, 2002 12:57:23 PM PST
36 */

37
38
39 //#-----------------------------------------------------------------------------
40
public class _JControlStub extends org.omg.CORBA.portable.ObjectImpl JavaDoc implements com.sun.jts.otsidl.JControl
41 {
42
43   public org.omg.CosTransactions.otid_t getGlobalTID (org.omg.CosTransactions.StatusHolder status)
44   {
45     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
46     try {
47        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getGlobalTID", true);
48        $in = _invoke ($out);
49        org.omg.CosTransactions.otid_t $result = org.omg.CosTransactions.otid_tHelper.read ($in);
50        status.value = org.omg.CosTransactions.StatusHelper.read ($in);
51        return $result;
52     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
53        $in = $ex.getInputStream ();
54        String JavaDoc _id = $ex.getId ();
55        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
56     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
57        return getGlobalTID (status);
58     } finally {
59         _releaseReply ($in);
60     }
61   } // getGlobalTID
62

63
64   // transaction, and a value that indicates the state of the transaction.
65
public long getLocalTID (org.omg.CosTransactions.StatusHolder status)
66   {
67     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
68     try {
69        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getLocalTID", true);
70        $in = _invoke ($out);
71        long $result = $in.read_longlong ();
72        status.value = org.omg.CosTransactions.StatusHelper.read ($in);
73        return $result;
74     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
75        $in = $ex.getInputStream ();
76        String JavaDoc _id = $ex.getId ();
77        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
78     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
79        return getLocalTID (status);
80     } finally {
81         _releaseReply ($in);
82     }
83   } // getLocalTID
84

85
86   // value that indicates the state of the transaction.
87
public org.omg.CosTransactions.Status getTranState ()
88   {
89     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
90     try {
91        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getTranState", true);
92        $in = _invoke ($out);
93        org.omg.CosTransactions.Status $result = org.omg.CosTransactions.StatusHelper.read ($in);
94        return $result;
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        return getTranState ();
101     } finally {
102         _releaseReply ($in);
103     }
104   } // getTranState
105

106
107   // Returns the state of the transaction as the Control object knows it.
108
public void setTranState (org.omg.CosTransactions.Status state)
109   {
110     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
111     try {
112        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("setTranState", true);
113        org.omg.CosTransactions.StatusHelper.write ($out, state);
114        $in = _invoke ($out);
115     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
116        $in = $ex.getInputStream ();
117        String JavaDoc _id = $ex.getId ();
118        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
119     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
120        setTranState (state);
121     } finally {
122         _releaseReply ($in);
123     }
124   } // setTranState
125

126   public org.omg.CosTransactions.Terminator get_terminator () throws org.omg.CosTransactions.Unavailable
127   {
128     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
129     try {
130        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("get_terminator", true);
131        $in = _invoke ($out);
132        org.omg.CosTransactions.Terminator $result = org.omg.CosTransactions.TerminatorHelper.read ($in);
133        return $result;
134     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
135        $in = $ex.getInputStream ();
136        String JavaDoc _id = $ex.getId ();
137        if (_id.equals ("IDL:omg.org/CosTransactions/Unavailable:1.0"))
138           throw org.omg.CosTransactions.UnavailableHelper.read ($in);
139        else
140             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
141     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
142        return get_terminator ();
143     } finally {
144         _releaseReply ($in);
145     }
146   } // get_terminator
147

148   public org.omg.CosTransactions.Coordinator get_coordinator () throws org.omg.CosTransactions.Unavailable
149   {
150     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
151     try {
152        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("get_coordinator", true);
153        $in = _invoke ($out);
154        org.omg.CosTransactions.Coordinator $result = org.omg.CosTransactions.CoordinatorHelper.read ($in);
155        return $result;
156     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
157        $in = $ex.getInputStream ();
158        String JavaDoc _id = $ex.getId ();
159        if (_id.equals ("IDL:omg.org/CosTransactions/Unavailable:1.0"))
160           throw org.omg.CosTransactions.UnavailableHelper.read ($in);
161        else
162             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
163     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
164        return get_coordinator ();
165     } finally {
166         _releaseReply ($in);
167     }
168   } // get_coordinator
169

170   // Type-specific CORBA::Object operations
171
private static String JavaDoc[] __ids = {
172     "IDL:otsidl/JControl:1.0",
173     "IDL:omg.org/CosTransactions/Control:1.0"};
174
175   public String JavaDoc[] _ids ()
176   {
177     return (String JavaDoc[])__ids.clone ();
178   }
179
180   private void readObject (java.io.ObjectInputStream JavaDoc s) throws java.io.IOException JavaDoc
181   {
182      String JavaDoc str = s.readUTF ();
183      String JavaDoc[] args = null;
184      java.util.Properties JavaDoc props = null;
185      org.omg.CORBA.Object JavaDoc obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
186      org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc) obj)._get_delegate ();
187      _set_delegate (delegate);
188   }
189
190   private void writeObject (java.io.ObjectOutputStream JavaDoc s) throws java.io.IOException JavaDoc
191   {
192      String JavaDoc[] args = null;
193      java.util.Properties JavaDoc props = null;
194      String JavaDoc str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
195      s.writeUTF (str);
196   }
197 } // class _JControlStub
198
Popular Tags