KickJava   Java API By Example, From Geeks To Geeks.

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


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/_JCoordinatorStub.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 _JCoordinatorStub extends org.omg.CORBA.portable.ObjectImpl JavaDoc implements com.sun.jts.otsidl.JCoordinator
41 {
42
43   public org.omg.CosTransactions.otid_t getGlobalTID ()
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        return $result;
51     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
52        $in = $ex.getInputStream ();
53        String JavaDoc _id = $ex.getId ();
54        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
55     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
56        return getGlobalTID ();
57     } finally {
58         _releaseReply ($in);
59     }
60   } // getGlobalTID
61

62
63   // Returns the global identifier that represents the Coordinator's transaction.
64
public long getLocalTID ()
65   {
66     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
67     try {
68        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getLocalTID", true);
69        $in = _invoke ($out);
70        long $result = $in.read_longlong ();
71        return $result;
72     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
73        $in = $ex.getInputStream ();
74        String JavaDoc _id = $ex.getId ();
75        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
76     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
77        return getLocalTID ();
78     } finally {
79         _releaseReply ($in);
80     }
81   } // getLocalTID
82

83
84   // Returns the local identifier that represents the Coordinator's transaction.
85
public org.omg.CosTransactions.TransIdentity[] getAncestors ()
86   {
87     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
88     try {
89        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("getAncestors", true);
90        $in = _invoke ($out);
91        org.omg.CosTransactions.TransIdentity $result[] = com.sun.jts.otsidl.TransAncestryHelper.read ($in);
92        return $result;
93     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
94        $in = $ex.getInputStream ();
95        String JavaDoc _id = $ex.getId ();
96        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
97     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
98        return getAncestors ();
99     } finally {
100         _releaseReply ($in);
101     }
102   } // getAncestors
103

104
105   // freeing the sequence storage.
106
public boolean isRollbackOnly ()
107   {
108     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
109     try {
110        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("isRollbackOnly", true);
111        $in = _invoke ($out);
112        boolean $result = $in.read_boolean ();
113        return $result;
114     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
115        $in = $ex.getInputStream ();
116        String JavaDoc _id = $ex.getId ();
117        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
118     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
119        return isRollbackOnly ();
120     } finally {
121         _releaseReply ($in);
122     }
123   } // isRollbackOnly
124

125   public org.omg.CosTransactions.Status get_status ()
126   {
127     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
128     try {
129        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("get_status", true);
130        $in = _invoke ($out);
131        org.omg.CosTransactions.Status $result = org.omg.CosTransactions.StatusHelper.read ($in);
132        return $result;
133     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
134        $in = $ex.getInputStream ();
135        String JavaDoc _id = $ex.getId ();
136        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
137     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
138        return get_status ();
139     } finally {
140         _releaseReply ($in);
141     }
142   } // get_status
143

144   public org.omg.CosTransactions.Status get_parent_status ()
145   {
146     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
147     try {
148        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("get_parent_status", true);
149        $in = _invoke ($out);
150        org.omg.CosTransactions.Status $result = org.omg.CosTransactions.StatusHelper.read ($in);
151        return $result;
152     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
153        $in = $ex.getInputStream ();
154        String JavaDoc _id = $ex.getId ();
155        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
156     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
157        return get_parent_status ();
158     } finally {
159         _releaseReply ($in);
160     }
161   } // get_parent_status
162

163   public org.omg.CosTransactions.Status get_top_level_status ()
164   {
165     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
166     try {
167        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("get_top_level_status", true);
168        $in = _invoke ($out);
169        org.omg.CosTransactions.Status $result = org.omg.CosTransactions.StatusHelper.read ($in);
170        return $result;
171     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
172        $in = $ex.getInputStream ();
173        String JavaDoc _id = $ex.getId ();
174        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
175     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
176        return get_top_level_status ();
177     } finally {
178         _releaseReply ($in);
179     }
180   } // get_top_level_status
181

182   public boolean is_same_transaction (org.omg.CosTransactions.Coordinator tc)
183   {
184     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
185     try {
186        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("is_same_transaction", true);
187        org.omg.CosTransactions.CoordinatorHelper.write ($out, tc);
188        $in = _invoke ($out);
189        boolean $result = $in.read_boolean ();
190        return $result;
191     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
192        $in = $ex.getInputStream ();
193        String JavaDoc _id = $ex.getId ();
194        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
195     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
196        return is_same_transaction (tc);
197     } finally {
198         _releaseReply ($in);
199     }
200   } // is_same_transaction
201

202   public boolean is_related_transaction (org.omg.CosTransactions.Coordinator tc)
203   {
204     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
205     try {
206        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("is_related_transaction", true);
207        org.omg.CosTransactions.CoordinatorHelper.write ($out, tc);
208        $in = _invoke ($out);
209        boolean $result = $in.read_boolean ();
210        return $result;
211     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
212        $in = $ex.getInputStream ();
213        String JavaDoc _id = $ex.getId ();
214        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
215     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
216        return is_related_transaction (tc);
217     } finally {
218         _releaseReply ($in);
219     }
220   } // is_related_transaction
221

222   public boolean is_ancestor_transaction (org.omg.CosTransactions.Coordinator tc)
223   {
224     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
225     try {
226        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("is_ancestor_transaction", true);
227        org.omg.CosTransactions.CoordinatorHelper.write ($out, tc);
228        $in = _invoke ($out);
229        boolean $result = $in.read_boolean ();
230        return $result;
231     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
232        $in = $ex.getInputStream ();
233        String JavaDoc _id = $ex.getId ();
234        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
235     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
236        return is_ancestor_transaction (tc);
237     } finally {
238         _releaseReply ($in);
239     }
240   } // is_ancestor_transaction
241

242   public boolean is_descendant_transaction (org.omg.CosTransactions.Coordinator tc)
243   {
244     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
245     try {
246        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("is_descendant_transaction", true);
247        org.omg.CosTransactions.CoordinatorHelper.write ($out, tc);
248        $in = _invoke ($out);
249        boolean $result = $in.read_boolean ();
250        return $result;
251     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
252        $in = $ex.getInputStream ();
253        String JavaDoc _id = $ex.getId ();
254        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
255     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
256        return is_descendant_transaction (tc);
257     } finally {
258         _releaseReply ($in);
259     }
260   } // is_descendant_transaction
261

262   public boolean is_top_level_transaction ()
263   {
264     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
265     try {
266        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("is_top_level_transaction", true);
267        $in = _invoke ($out);
268        boolean $result = $in.read_boolean ();
269        return $result;
270     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
271        $in = $ex.getInputStream ();
272        String JavaDoc _id = $ex.getId ();
273        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
274     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
275        return is_top_level_transaction ();
276     } finally {
277         _releaseReply ($in);
278     }
279   } // is_top_level_transaction
280

281   public int hash_transaction ()
282   {
283     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
284     try {
285        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("hash_transaction", true);
286        $in = _invoke ($out);
287        int $result = $in.read_ulong ();
288        return $result;
289     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
290        $in = $ex.getInputStream ();
291        String JavaDoc _id = $ex.getId ();
292        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
293     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
294        return hash_transaction ();
295     } finally {
296         _releaseReply ($in);
297     }
298   } // hash_transaction
299

300   public int hash_top_level_tran ()
301   {
302     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
303     try {
304        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("hash_top_level_tran", true);
305        $in = _invoke ($out);
306        int $result = $in.read_ulong ();
307        return $result;
308     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
309        $in = $ex.getInputStream ();
310        String JavaDoc _id = $ex.getId ();
311        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
312     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
313        return hash_top_level_tran ();
314     } finally {
315         _releaseReply ($in);
316     }
317   } // hash_top_level_tran
318

319   public org.omg.CosTransactions.RecoveryCoordinator register_resource (org.omg.CosTransactions.Resource r) throws org.omg.CosTransactions.Inactive
320   {
321     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
322     try {
323        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("register_resource", true);
324        org.omg.CosTransactions.ResourceHelper.write ($out, r);
325        $in = _invoke ($out);
326        org.omg.CosTransactions.RecoveryCoordinator $result = org.omg.CosTransactions.RecoveryCoordinatorHelper.read ($in);
327        return $result;
328     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
329        $in = $ex.getInputStream ();
330        String JavaDoc _id = $ex.getId ();
331        if (_id.equals ("IDL:omg.org/CosTransactions/Inactive:1.0"))
332           throw org.omg.CosTransactions.InactiveHelper.read ($in);
333        else
334             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
335     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
336        return register_resource (r);
337     } finally {
338         _releaseReply ($in);
339     }
340   } // register_resource
341

342   public void register_synchronization (org.omg.CosTransactions.Synchronization sync) throws org.omg.CosTransactions.Inactive, org.omg.CosTransactions.SynchronizationUnavailable
343   {
344     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
345     try {
346        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("register_synchronization", true);
347        org.omg.CosTransactions.SynchronizationHelper.write ($out, sync);
348        $in = _invoke ($out);
349     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
350        $in = $ex.getInputStream ();
351        String JavaDoc _id = $ex.getId ();
352        if (_id.equals ("IDL:omg.org/CosTransactions/Inactive:1.0"))
353           throw org.omg.CosTransactions.InactiveHelper.read ($in);
354        else if (_id.equals ("IDL:omg.org/CosTransactions/SynchronizationUnavailable:1.0"))
355           throw org.omg.CosTransactions.SynchronizationUnavailableHelper.read ($in);
356        else
357             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
358     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
359        register_synchronization (sync);
360     } finally {
361         _releaseReply ($in);
362     }
363   } // register_synchronization
364

365   public void register_subtran_aware (org.omg.CosTransactions.SubtransactionAwareResource r) throws org.omg.CosTransactions.Inactive, org.omg.CosTransactions.NotSubtransaction
366   {
367     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
368     try {
369        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("register_subtran_aware", true);
370        org.omg.CosTransactions.SubtransactionAwareResourceHelper.write ($out, r);
371        $in = _invoke ($out);
372     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
373        $in = $ex.getInputStream ();
374        String JavaDoc _id = $ex.getId ();
375        if (_id.equals ("IDL:omg.org/CosTransactions/Inactive:1.0"))
376           throw org.omg.CosTransactions.InactiveHelper.read ($in);
377        else if (_id.equals ("IDL:omg.org/CosTransactions/NotSubtransaction:1.0"))
378           throw org.omg.CosTransactions.NotSubtransactionHelper.read ($in);
379        else
380             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
381     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
382        register_subtran_aware (r);
383     } finally {
384         _releaseReply ($in);
385     }
386   } // register_subtran_aware
387

388   public void rollback_only () throws org.omg.CosTransactions.Inactive
389   {
390     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
391     try {
392        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("rollback_only", true);
393        $in = _invoke ($out);
394     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
395        $in = $ex.getInputStream ();
396        String JavaDoc _id = $ex.getId ();
397        if (_id.equals ("IDL:omg.org/CosTransactions/Inactive:1.0"))
398           throw org.omg.CosTransactions.InactiveHelper.read ($in);
399        else
400             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
401     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
402        rollback_only ();
403     } finally {
404         _releaseReply ($in);
405     }
406   } // rollback_only
407

408   public String JavaDoc get_transaction_name ()
409   {
410     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
411     try {
412        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("get_transaction_name", true);
413        $in = _invoke ($out);
414        String JavaDoc $result = $in.read_string ();
415        return $result;
416     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
417        $in = $ex.getInputStream ();
418        String JavaDoc _id = $ex.getId ();
419        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
420     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
421        return get_transaction_name ();
422     } finally {
423         _releaseReply ($in);
424     }
425   } // get_transaction_name
426

427   public org.omg.CosTransactions.Control create_subtransaction () throws org.omg.CosTransactions.SubtransactionsUnavailable, org.omg.CosTransactions.Inactive
428   {
429     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
430     try {
431        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("create_subtransaction", true);
432        $in = _invoke ($out);
433        org.omg.CosTransactions.Control $result = org.omg.CosTransactions.ControlHelper.read ($in);
434        return $result;
435     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
436        $in = $ex.getInputStream ();
437        String JavaDoc _id = $ex.getId ();
438        if (_id.equals ("IDL:omg.org/CosTransactions/SubtransactionsUnavailable:1.0"))
439           throw org.omg.CosTransactions.SubtransactionsUnavailableHelper.read ($in);
440        else if (_id.equals ("IDL:omg.org/CosTransactions/Inactive:1.0"))
441           throw org.omg.CosTransactions.InactiveHelper.read ($in);
442        else
443             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
444     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
445        return create_subtransaction ();
446     } finally {
447         _releaseReply ($in);
448     }
449   } // create_subtransaction
450

451   public org.omg.CosTransactions.PropagationContext get_txcontext () throws org.omg.CosTransactions.Unavailable
452   {
453     org.omg.CORBA.portable.InputStream JavaDoc $in = null;
454     try {
455        org.omg.CORBA.portable.OutputStream JavaDoc $out = _request ("get_txcontext", true);
456        $in = _invoke ($out);
457        org.omg.CosTransactions.PropagationContext $result = org.omg.CosTransactions.PropagationContextHelper.read ($in);
458        return $result;
459     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc $ex) {
460        $in = $ex.getInputStream ();
461        String JavaDoc _id = $ex.getId ();
462        if (_id.equals ("IDL:omg.org/CosTransactions/Unavailable:1.0"))
463           throw org.omg.CosTransactions.UnavailableHelper.read ($in);
464        else
465             throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
466     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc $rm) {
467        return get_txcontext ();
468     } finally {
469         _releaseReply ($in);
470     }
471   } // get_txcontext
472

473   // Type-specific CORBA::Object operations
474
private static String JavaDoc[] __ids = {
475     "IDL:otsidl/JCoordinator:1.0",
476     "IDL:omg.org/CosTransactions/Coordinator:1.0"};
477
478   public String JavaDoc[] _ids ()
479   {
480     return (String JavaDoc[])__ids.clone ();
481   }
482
483   private void readObject (java.io.ObjectInputStream JavaDoc s) throws java.io.IOException JavaDoc
484   {
485      String JavaDoc str = s.readUTF ();
486      String JavaDoc[] args = null;
487      java.util.Properties JavaDoc props = null;
488      org.omg.CORBA.Object JavaDoc obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
489      org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc) obj)._get_delegate ();
490      _set_delegate (delegate);
491   }
492
493   private void writeObject (java.io.ObjectOutputStream JavaDoc s) throws java.io.IOException JavaDoc
494   {
495      String JavaDoc[] args = null;
496      java.util.Properties JavaDoc props = null;
497      String JavaDoc str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
498      s.writeUTF (str);
499   }
500 } // class _JCoordinatorStub
501
Popular Tags