KickJava   Java API By Example, From Geeks To Geeks.

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


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/JCoordinatorPOA.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 abstract class JCoordinatorPOA extends org.omg.PortableServer.Servant JavaDoc
41  implements com.sun.jts.otsidl.JCoordinatorOperations, org.omg.CORBA.portable.InvokeHandler JavaDoc
42 {
43
44   // Constructors
45

46   private static java.util.Hashtable JavaDoc _methods = new java.util.Hashtable JavaDoc ();
47   static
48   {
49     _methods.put ("getGlobalTID", new java.lang.Integer JavaDoc (0));
50     _methods.put ("getLocalTID", new java.lang.Integer JavaDoc (1));
51     _methods.put ("getAncestors", new java.lang.Integer JavaDoc (2));
52     _methods.put ("isRollbackOnly", new java.lang.Integer JavaDoc (3));
53     _methods.put ("get_status", new java.lang.Integer JavaDoc (4));
54     _methods.put ("get_parent_status", new java.lang.Integer JavaDoc (5));
55     _methods.put ("get_top_level_status", new java.lang.Integer JavaDoc (6));
56     _methods.put ("is_same_transaction", new java.lang.Integer JavaDoc (7));
57     _methods.put ("is_related_transaction", new java.lang.Integer JavaDoc (8));
58     _methods.put ("is_ancestor_transaction", new java.lang.Integer JavaDoc (9));
59     _methods.put ("is_descendant_transaction", new java.lang.Integer JavaDoc (10));
60     _methods.put ("is_top_level_transaction", new java.lang.Integer JavaDoc (11));
61     _methods.put ("hash_transaction", new java.lang.Integer JavaDoc (12));
62     _methods.put ("hash_top_level_tran", new java.lang.Integer JavaDoc (13));
63     _methods.put ("register_resource", new java.lang.Integer JavaDoc (14));
64     _methods.put ("register_synchronization", new java.lang.Integer JavaDoc (15));
65     _methods.put ("register_subtran_aware", new java.lang.Integer JavaDoc (16));
66     _methods.put ("rollback_only", new java.lang.Integer JavaDoc (17));
67     _methods.put ("get_transaction_name", new java.lang.Integer JavaDoc (18));
68     _methods.put ("create_subtransaction", new java.lang.Integer JavaDoc (19));
69     _methods.put ("get_txcontext", new java.lang.Integer JavaDoc (20));
70   }
71
72   public org.omg.CORBA.portable.OutputStream JavaDoc _invoke (String JavaDoc $method,
73                                 org.omg.CORBA.portable.InputStream JavaDoc in,
74                                 org.omg.CORBA.portable.ResponseHandler JavaDoc $rh)
75   {
76     org.omg.CORBA.portable.OutputStream JavaDoc out = null;
77     java.lang.Integer JavaDoc __method = (java.lang.Integer JavaDoc)_methods.get ($method);
78     if (__method == null)
79       throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
80
81     switch (__method.intValue ())
82     {
83        case 0: // otsidl/JCoordinator/getGlobalTID
84
{
85          org.omg.CosTransactions.otid_t $result = null;
86          $result = this.getGlobalTID ();
87          out = $rh.createReply();
88          org.omg.CosTransactions.otid_tHelper.write (out, $result);
89          break;
90        }
91
92
93   // Returns the global identifier that represents the Coordinator's transaction.
94
case 1: // otsidl/JCoordinator/getLocalTID
95
{
96          long $result = (long)0;
97          $result = this.getLocalTID ();
98          out = $rh.createReply();
99          out.write_longlong ($result);
100          break;
101        }
102
103
104   // Returns the local identifier that represents the Coordinator's transaction.
105
case 2: // otsidl/JCoordinator/getAncestors
106
{
107          org.omg.CosTransactions.TransIdentity $result[] = null;
108          $result = this.getAncestors ();
109          out = $rh.createReply();
110          com.sun.jts.otsidl.TransAncestryHelper.write (out, $result);
111          break;
112        }
113
114
115   // freeing the sequence storage.
116
case 3: // otsidl/JCoordinator/isRollbackOnly
117
{
118          boolean $result = false;
119          $result = this.isRollbackOnly ();
120          out = $rh.createReply();
121          out.write_boolean ($result);
122          break;
123        }
124
125        case 4: // CosTransactions/Coordinator/get_status
126
{
127          org.omg.CosTransactions.Status $result = null;
128          $result = this.get_status ();
129          out = $rh.createReply();
130          org.omg.CosTransactions.StatusHelper.write (out, $result);
131          break;
132        }
133
134        case 5: // CosTransactions/Coordinator/get_parent_status
135
{
136          org.omg.CosTransactions.Status $result = null;
137          $result = this.get_parent_status ();
138          out = $rh.createReply();
139          org.omg.CosTransactions.StatusHelper.write (out, $result);
140          break;
141        }
142
143        case 6: // CosTransactions/Coordinator/get_top_level_status
144
{
145          org.omg.CosTransactions.Status $result = null;
146          $result = this.get_top_level_status ();
147          out = $rh.createReply();
148          org.omg.CosTransactions.StatusHelper.write (out, $result);
149          break;
150        }
151
152        case 7: // CosTransactions/Coordinator/is_same_transaction
153
{
154          org.omg.CosTransactions.Coordinator tc = org.omg.CosTransactions.CoordinatorHelper.read (in);
155          boolean $result = false;
156          $result = this.is_same_transaction (tc);
157          out = $rh.createReply();
158          out.write_boolean ($result);
159          break;
160        }
161
162        case 8: // CosTransactions/Coordinator/is_related_transaction
163
{
164          org.omg.CosTransactions.Coordinator tc = org.omg.CosTransactions.CoordinatorHelper.read (in);
165          boolean $result = false;
166          $result = this.is_related_transaction (tc);
167          out = $rh.createReply();
168          out.write_boolean ($result);
169          break;
170        }
171
172        case 9: // CosTransactions/Coordinator/is_ancestor_transaction
173
{
174          org.omg.CosTransactions.Coordinator tc = org.omg.CosTransactions.CoordinatorHelper.read (in);
175          boolean $result = false;
176          $result = this.is_ancestor_transaction (tc);
177          out = $rh.createReply();
178          out.write_boolean ($result);
179          break;
180        }
181
182        case 10: // CosTransactions/Coordinator/is_descendant_transaction
183
{
184          org.omg.CosTransactions.Coordinator tc = org.omg.CosTransactions.CoordinatorHelper.read (in);
185          boolean $result = false;
186          $result = this.is_descendant_transaction (tc);
187          out = $rh.createReply();
188          out.write_boolean ($result);
189          break;
190        }
191
192        case 11: // CosTransactions/Coordinator/is_top_level_transaction
193
{
194          boolean $result = false;
195          $result = this.is_top_level_transaction ();
196          out = $rh.createReply();
197          out.write_boolean ($result);
198          break;
199        }
200
201        case 12: // CosTransactions/Coordinator/hash_transaction
202
{
203          int $result = (int)0;
204          $result = this.hash_transaction ();
205          out = $rh.createReply();
206          out.write_ulong ($result);
207          break;
208        }
209
210        case 13: // CosTransactions/Coordinator/hash_top_level_tran
211
{
212          int $result = (int)0;
213          $result = this.hash_top_level_tran ();
214          out = $rh.createReply();
215          out.write_ulong ($result);
216          break;
217        }
218
219        case 14: // CosTransactions/Coordinator/register_resource
220
{
221          try {
222            org.omg.CosTransactions.Resource r = org.omg.CosTransactions.ResourceHelper.read (in);
223            org.omg.CosTransactions.RecoveryCoordinator $result = null;
224            $result = this.register_resource (r);
225            out = $rh.createReply();
226            org.omg.CosTransactions.RecoveryCoordinatorHelper.write (out, $result);
227          } catch (org.omg.CosTransactions.Inactive $ex) {
228            out = $rh.createExceptionReply ();
229            org.omg.CosTransactions.InactiveHelper.write (out, $ex);
230          }
231          break;
232        }
233
234        case 15: // CosTransactions/Coordinator/register_synchronization
235
{
236          try {
237            org.omg.CosTransactions.Synchronization sync = org.omg.CosTransactions.SynchronizationHelper.read (in);
238            this.register_synchronization (sync);
239            out = $rh.createReply();
240          } catch (org.omg.CosTransactions.Inactive $ex) {
241            out = $rh.createExceptionReply ();
242            org.omg.CosTransactions.InactiveHelper.write (out, $ex);
243          } catch (org.omg.CosTransactions.SynchronizationUnavailable $ex) {
244            out = $rh.createExceptionReply ();
245            org.omg.CosTransactions.SynchronizationUnavailableHelper.write (out, $ex);
246          }
247          break;
248        }
249
250        case 16: // CosTransactions/Coordinator/register_subtran_aware
251
{
252          try {
253            org.omg.CosTransactions.SubtransactionAwareResource r = org.omg.CosTransactions.SubtransactionAwareResourceHelper.read (in);
254            this.register_subtran_aware (r);
255            out = $rh.createReply();
256          } catch (org.omg.CosTransactions.Inactive $ex) {
257            out = $rh.createExceptionReply ();
258            org.omg.CosTransactions.InactiveHelper.write (out, $ex);
259          } catch (org.omg.CosTransactions.NotSubtransaction $ex) {
260            out = $rh.createExceptionReply ();
261            org.omg.CosTransactions.NotSubtransactionHelper.write (out, $ex);
262          }
263          break;
264        }
265
266        case 17: // CosTransactions/Coordinator/rollback_only
267
{
268          try {
269            this.rollback_only ();
270            out = $rh.createReply();
271          } catch (org.omg.CosTransactions.Inactive $ex) {
272            out = $rh.createExceptionReply ();
273            org.omg.CosTransactions.InactiveHelper.write (out, $ex);
274          }
275          break;
276        }
277
278        case 18: // CosTransactions/Coordinator/get_transaction_name
279
{
280          String JavaDoc $result = null;
281          $result = this.get_transaction_name ();
282          out = $rh.createReply();
283          out.write_string ($result);
284          break;
285        }
286
287        case 19: // CosTransactions/Coordinator/create_subtransaction
288
{
289          try {
290            org.omg.CosTransactions.Control $result = null;
291            $result = this.create_subtransaction ();
292            out = $rh.createReply();
293            org.omg.CosTransactions.ControlHelper.write (out, $result);
294          } catch (org.omg.CosTransactions.SubtransactionsUnavailable $ex) {
295            out = $rh.createExceptionReply ();
296            org.omg.CosTransactions.SubtransactionsUnavailableHelper.write (out, $ex);
297          } catch (org.omg.CosTransactions.Inactive $ex) {
298            out = $rh.createExceptionReply ();
299            org.omg.CosTransactions.InactiveHelper.write (out, $ex);
300          }
301          break;
302        }
303
304        case 20: // CosTransactions/Coordinator/get_txcontext
305
{
306          try {
307            org.omg.CosTransactions.PropagationContext $result = null;
308            $result = this.get_txcontext ();
309            out = $rh.createReply();
310            org.omg.CosTransactions.PropagationContextHelper.write (out, $result);
311          } catch (org.omg.CosTransactions.Unavailable $ex) {
312            out = $rh.createExceptionReply ();
313            org.omg.CosTransactions.UnavailableHelper.write (out, $ex);
314          }
315          break;
316        }
317
318        default:
319          throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
320     }
321
322     return out;
323   } // _invoke
324

325   // Type-specific CORBA::Object operations
326
private static String JavaDoc[] __ids = {
327     "IDL:otsidl/JCoordinator:1.0",
328     "IDL:omg.org/CosTransactions/Coordinator:1.0"};
329
330   public String JavaDoc[] _all_interfaces (org.omg.PortableServer.POA JavaDoc poa, byte[] objectId)
331   {
332     return (String JavaDoc[])__ids.clone ();
333   }
334
335   public JCoordinator _this()
336   {
337     return JCoordinatorHelper.narrow(
338     super._this_object());
339   }
340
341   public JCoordinator _this(org.omg.CORBA.ORB JavaDoc orb)
342   {
343     return JCoordinatorHelper.narrow(
344     super._this_object(orb));
345   }
346
347
348 } // class JCoordinatorPOA
349
Popular Tags