KickJava   Java API By Example, From Geeks To Geeks.

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


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/_CoordinatorResourceStub.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 _CoordinatorResourceStub extends org.omg.CORBA.portable.ObjectImpl JavaDoc implements com.sun.jts.otsidl.CoordinatorResource
41 {
42
43   public void commit_subtransaction (org.omg.CosTransactions.Coordinator parent)
44   {
45     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
46     try {
47        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("commit_subtransaction", true);
48        org.omg.CosTransactions.CoordinatorHelper.write ($out, parent);
49        $in = _invoke ($out);
50     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
51        $in = $ex.getInputStream ();
52        String JavaDoc _id = $ex.getId ();
53        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
54     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
55        commit_subtransaction (parent);
56     } finally {
57         _releaseReply ($in);
58     }
59   } // commit_subtransaction
60

61   public void rollback_subtransaction ()
62   {
63     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
64     try {
65        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("rollback_subtransaction", true);
66        $in = _invoke ($out);
67     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
68        $in = $ex.getInputStream ();
69        String JavaDoc _id = $ex.getId ();
70        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
71     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
72        rollback_subtransaction ();
73     } finally {
74         _releaseReply ($in);
75     }
76   } // rollback_subtransaction
77

78   public org.omg.CosTransactions.Vote prepare () throws org.omg.CosTransactions.HeuristicMixed, org.omg.CosTransactions.HeuristicHazard
79   {
80     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
81     try {
82        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("prepare", true);
83        $in = _invoke ($out);
84        org.omg.CosTransactions.Vote $result = org.omg.CosTransactions.VoteHelper.read ($in);
85        return $result;
86     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
87        $in = $ex.getInputStream ();
88        String JavaDoc _id = $ex.getId ();
89        if (_id.equals ("IDL:omg.org/CosTransactions/HeuristicMixed:1.0"))
90           throw org.omg.CosTransactions.HeuristicMixedHelper.read ($in);
91        else if (_id.equals ("IDL:omg.org/CosTransactions/HeuristicHazard:1.0"))
92           throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in);
93        else
94             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
95     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
96        return prepare ();
97     } finally {
98         _releaseReply ($in);
99     }
100   } // prepare
101

102   public void rollback () throws org.omg.CosTransactions.HeuristicCommit, org.omg.CosTransactions.HeuristicMixed, org.omg.CosTransactions.HeuristicHazard
103   {
104     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
105     try {
106        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("rollback", true);
107        $in = _invoke ($out);
108     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
109        $in = $ex.getInputStream ();
110        String JavaDoc _id = $ex.getId ();
111        if (_id.equals ("IDL:omg.org/CosTransactions/HeuristicCommit:1.0"))
112           throw org.omg.CosTransactions.HeuristicCommitHelper.read ($in);
113        else if (_id.equals ("IDL:omg.org/CosTransactions/HeuristicMixed:1.0"))
114           throw org.omg.CosTransactions.HeuristicMixedHelper.read ($in);
115        else if (_id.equals ("IDL:omg.org/CosTransactions/HeuristicHazard:1.0"))
116           throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in);
117        else
118             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
119     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
120        rollback ();
121     } finally {
122         _releaseReply ($in);
123     }
124   } // rollback
125

126   public void commit () throws org.omg.CosTransactions.NotPrepared, org.omg.CosTransactions.HeuristicRollback, org.omg.CosTransactions.HeuristicMixed, org.omg.CosTransactions.HeuristicHazard
127   {
128     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
129     try {
130        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("commit", true);
131        $in = _invoke ($out);
132     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
133        $in = $ex.getInputStream ();
134        String JavaDoc _id = $ex.getId ();
135        if (_id.equals ("IDL:omg.org/CosTransactions/NotPrepared:1.0"))
136           throw org.omg.CosTransactions.NotPreparedHelper.read ($in);
137        else if (_id.equals ("IDL:omg.org/CosTransactions/HeuristicRollback:1.0"))
138           throw org.omg.CosTransactions.HeuristicRollbackHelper.read ($in);
139        else if (_id.equals ("IDL:omg.org/CosTransactions/HeuristicMixed:1.0"))
140           throw org.omg.CosTransactions.HeuristicMixedHelper.read ($in);
141        else if (_id.equals ("IDL:omg.org/CosTransactions/HeuristicHazard:1.0"))
142           throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in);
143        else
144             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
145     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
146        commit ();
147     } finally {
148         _releaseReply ($in);
149     }
150   } // commit
151

152   public void commit_one_phase () throws org.omg.CosTransactions.HeuristicHazard
153   {
154     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
155     try {
156        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("commit_one_phase", true);
157        $in = _invoke ($out);
158     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
159        $in = $ex.getInputStream ();
160        String JavaDoc _id = $ex.getId ();
161        if (_id.equals ("IDL:omg.org/CosTransactions/HeuristicHazard:1.0"))
162           throw org.omg.CosTransactions.HeuristicHazardHelper.read ($in);
163        else
164             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
165     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
166        commit_one_phase ();
167     } finally {
168         _releaseReply ($in);
169     }
170   } // commit_one_phase
171

172   public void forget ()
173   {
174     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
175     try {
176        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("forget", true);
177        $in = _invoke ($out);
178     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
179        $in = $ex.getInputStream ();
180        String JavaDoc _id = $ex.getId ();
181        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
182     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
183        forget ();
184     } finally {
185         _releaseReply ($in);
186     }
187   } // forget
188

189   // Type-specific CORBA::Object operations
190
private static String JavaDoc[] __ids = {
191     "IDL:otsidl/CoordinatorResource:1.0",
192     "IDL:omg.org/CosTransactions/SubtransactionAwareResource:1.0",
193     "IDL:omg.org/CosTransactions/Resource:1.0"};
194
195   public String JavaDoc[] _ids ()
196   {
197     return (String JavaDoc[])__ids.clone ();
198   }
199
200   private void readObject (java.io.ObjectInputStream JavaDoc s) throws java.io.IOException JavaDoc
201   {
202      String JavaDoc str = s.readUTF ();
203      String JavaDoc[] args = null;
204      java.util.Properties JavaDoc props = null;
205      org.omg.CORBA.Object JavaDoc obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
206      org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc) obj)._get_delegate ();
207      _set_delegate (delegate);
208   }
209
210   private void writeObject (java.io.ObjectOutputStream JavaDoc s) throws java.io.IOException JavaDoc
211   {
212      String JavaDoc[] args = null;
213      java.util.Properties JavaDoc props = null;
214      String JavaDoc str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
215      s.writeUTF (str);
216   }
217 } // class _CoordinatorResourceStub
218
Popular Tags