KickJava   Java API By Example, From Geeks To Geeks.

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


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/JControlPOA.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 JControlPOA extends org.omg.PortableServer.Servant JavaDoc
41  implements com.sun.jts.otsidl.JControlOperations, 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 ("getTranState", new java.lang.Integer JavaDoc (2));
52     _methods.put ("setTranState", new java.lang.Integer JavaDoc (3));
53     _methods.put ("get_terminator", new java.lang.Integer JavaDoc (4));
54     _methods.put ("get_coordinator", 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: // otsidl/JControl/getGlobalTID
69
{
70          org.omg.CosTransactions.StatusHolder status = new org.omg.CosTransactions.StatusHolder ();
71          org.omg.CosTransactions.otid_t $result = null;
72          $result = this.getGlobalTID (status);
73          out = $rh.createReply();
74          org.omg.CosTransactions.otid_tHelper.write (out, $result);
75          org.omg.CosTransactions.StatusHelper.write (out, status.value);
76          break;
77        }
78
79
80   // transaction, and a value that indicates the state of the transaction.
81
case 1: // otsidl/JControl/getLocalTID
82
{
83          org.omg.CosTransactions.StatusHolder status = new org.omg.CosTransactions.StatusHolder ();
84          long $result = (long)0;
85          $result = this.getLocalTID (status);
86          out = $rh.createReply();
87          out.write_longlong ($result);
88          org.omg.CosTransactions.StatusHelper.write (out, status.value);
89          break;
90        }
91
92
93   // value that indicates the state of the transaction.
94
case 2: // otsidl/JControl/getTranState
95
{
96          org.omg.CosTransactions.Status $result = null;
97          $result = this.getTranState ();
98          out = $rh.createReply();
99          org.omg.CosTransactions.StatusHelper.write (out, $result);
100          break;
101        }
102
103
104   // Returns the state of the transaction as the Control object knows it.
105
case 3: // otsidl/JControl/setTranState
106
{
107          org.omg.CosTransactions.Status state = org.omg.CosTransactions.StatusHelper.read (in);
108          this.setTranState (state);
109          out = $rh.createReply();
110          break;
111        }
112
113        case 4: // CosTransactions/Control/get_terminator
114
{
115          try {
116            org.omg.CosTransactions.Terminator $result = null;
117            $result = this.get_terminator ();
118            out = $rh.createReply();
119            org.omg.CosTransactions.TerminatorHelper.write (out, $result);
120          } catch (org.omg.CosTransactions.Unavailable $ex) {
121            out = $rh.createExceptionReply ();
122            org.omg.CosTransactions.UnavailableHelper.write (out, $ex);
123          }
124          break;
125        }
126
127        case 5: // CosTransactions/Control/get_coordinator
128
{
129          try {
130            org.omg.CosTransactions.Coordinator $result = null;
131            $result = this.get_coordinator ();
132            out = $rh.createReply();
133            org.omg.CosTransactions.CoordinatorHelper.write (out, $result);
134          } catch (org.omg.CosTransactions.Unavailable $ex) {
135            out = $rh.createExceptionReply ();
136            org.omg.CosTransactions.UnavailableHelper.write (out, $ex);
137          }
138          break;
139        }
140
141        default:
142          throw new org.omg.CORBA.BAD_OPERATION JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
143     }
144
145     return out;
146   } // _invoke
147

148   // Type-specific CORBA::Object operations
149
private static String JavaDoc[] __ids = {
150     "IDL:otsidl/JControl:1.0",
151     "IDL:omg.org/CosTransactions/Control:1.0"};
152
153   public String JavaDoc[] _all_interfaces (org.omg.PortableServer.POA JavaDoc poa, byte[] objectId)
154   {
155     return (String JavaDoc[])__ids.clone ();
156   }
157
158   public JControl _this()
159   {
160     return JControlHelper.narrow(
161     super._this_object());
162   }
163
164   public JControl _this(org.omg.CORBA.ORB JavaDoc orb)
165   {
166     return JControlHelper.narrow(
167     super._this_object(orb));
168   }
169
170
171 } // class JControlPOA
172
Popular Tags