KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jts > jtsxa > OTSResourcePOA


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.jtsxa;
29
30
31 /**
32 * com/sun/jts/jtsxa/OTSResourcePOA.java .
33 * Generated by the IDL-to-Java compiler (portable), version "3.1"
34 * from com/sun/jts/jtsxa.idl
35 * Tuesday, February 5, 2002 12:57:25 PM PST
36 */

37
38
39 //#-----------------------------------------------------------------------------
40
public abstract class OTSResourcePOA extends org.omg.PortableServer.Servant JavaDoc
41  implements com.sun.jts.jtsxa.OTSResourceOperations, 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 ("prepare", new java.lang.Integer JavaDoc (1));
51     _methods.put ("rollback", new java.lang.Integer JavaDoc (2));
52     _methods.put ("commit", new java.lang.Integer JavaDoc (3));
53     _methods.put ("commit_one_phase", new java.lang.Integer JavaDoc (4));
54     _methods.put ("forget", new java.lang.Integer JavaDoc (5));
55   }
56
57   public org.omg.CORBA.portable.OutputStream JavaDoc _invoke (String JavaDoc $method,
58                                 org.omg.CORBA.portable.InputStream JavaDoc in,
59                                 org.omg.CORBA.portable.ResponseHandler JavaDoc $rh)
60   {
61     org.omg.CORBA.portable.OutputStream JavaDoc out = null;
62     java.lang.Integer JavaDoc __method = (java.lang.Integer JavaDoc)_methods.get ($method);
63     if (__method == null)
64       throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
65
66     switch (__method.intValue ())
67     {
68        case 0: // jtsxa/OTSResource/getGlobalTID
69
{
70          org.omg.CosTransactions.otid_t $result = null;
71          $result = this.getGlobalTID ();
72          out = $rh.createReply();
73          org.omg.CosTransactions.otid_tHelper.write (out, $result);
74          break;
75        }
76
77        case 1: // CosTransactions/Resource/prepare
78
{
79          try {
80            org.omg.CosTransactions.Vote $result = null;
81            $result = this.prepare ();
82            out = $rh.createReply();
83            org.omg.CosTransactions.VoteHelper.write (out, $result);
84          } catch (org.omg.CosTransactions.HeuristicMixed $ex) {
85            out = $rh.createExceptionReply ();
86            org.omg.CosTransactions.HeuristicMixedHelper.write (out, $ex);
87          } catch (org.omg.CosTransactions.HeuristicHazard $ex) {
88            out = $rh.createExceptionReply ();
89            org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex);
90          }
91          break;
92        }
93
94        case 2: // CosTransactions/Resource/rollback
95
{
96          try {
97            this.rollback ();
98            out = $rh.createReply();
99          } catch (org.omg.CosTransactions.HeuristicCommit $ex) {
100            out = $rh.createExceptionReply ();
101            org.omg.CosTransactions.HeuristicCommitHelper.write (out, $ex);
102          } catch (org.omg.CosTransactions.HeuristicMixed $ex) {
103            out = $rh.createExceptionReply ();
104            org.omg.CosTransactions.HeuristicMixedHelper.write (out, $ex);
105          } catch (org.omg.CosTransactions.HeuristicHazard $ex) {
106            out = $rh.createExceptionReply ();
107            org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex);
108          }
109          break;
110        }
111
112        case 3: // CosTransactions/Resource/commit
113
{
114          try {
115            this.commit ();
116            out = $rh.createReply();
117          } catch (org.omg.CosTransactions.NotPrepared $ex) {
118            out = $rh.createExceptionReply ();
119            org.omg.CosTransactions.NotPreparedHelper.write (out, $ex);
120          } catch (org.omg.CosTransactions.HeuristicRollback $ex) {
121            out = $rh.createExceptionReply ();
122            org.omg.CosTransactions.HeuristicRollbackHelper.write (out, $ex);
123          } catch (org.omg.CosTransactions.HeuristicMixed $ex) {
124            out = $rh.createExceptionReply ();
125            org.omg.CosTransactions.HeuristicMixedHelper.write (out, $ex);
126          } catch (org.omg.CosTransactions.HeuristicHazard $ex) {
127            out = $rh.createExceptionReply ();
128            org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex);
129          }
130          break;
131        }
132
133        case 4: // CosTransactions/Resource/commit_one_phase
134
{
135          try {
136            this.commit_one_phase ();
137            out = $rh.createReply();
138          } catch (org.omg.CosTransactions.HeuristicHazard $ex) {
139            out = $rh.createExceptionReply ();
140            org.omg.CosTransactions.HeuristicHazardHelper.write (out, $ex);
141          }
142          break;
143        }
144
145        case 5: // CosTransactions/Resource/forget
146
{
147          this.forget ();
148          out = $rh.createReply();
149          break;
150        }
151
152        default:
153          throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
154     }
155
156     return out;
157   } // _invoke
158

159   // Type-specific CORBA::Object operations
160
private static String JavaDoc[] __ids = {
161     "IDL:jtsxa/OTSResource:1.0",
162     "IDL:omg.org/CosTransactions/Resource:1.0"};
163
164   public String JavaDoc[] _all_interfaces (org.omg.PortableServer.POA JavaDoc poa, byte[] objectId)
165   {
166     return (String JavaDoc[])__ids.clone ();
167   }
168
169   public OTSResource _this()
170   {
171     return OTSResourceHelper.narrow(
172     super._this_object());
173   }
174
175   public OTSResource _this(org.omg.CORBA.ORB JavaDoc orb)
176   {
177     return OTSResourceHelper.narrow(
178     super._this_object(orb));
179   }
180
181
182 } // class OTSResourcePOA
183
Popular Tags