KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jotm > _Coordinator_Stub


1 // Stub class generated by rmic, do not edit.
2
// Contents subject to change without notice.
3

4 package org.objectweb.jotm;
5
6 import java.io.Serializable JavaDoc;
7 import java.rmi.Remote JavaDoc;
8 import java.rmi.RemoteException JavaDoc;
9 import java.rmi.UnexpectedException JavaDoc;
10 import javax.rmi.CORBA.Stub JavaDoc;
11 import javax.rmi.CORBA.Util JavaDoc;
12 import javax.rmi.PortableRemoteObject JavaDoc;
13 import org.omg.CORBA.ORB JavaDoc;
14 import org.omg.CORBA.SystemException JavaDoc;
15 import org.omg.CORBA.portable.ApplicationException JavaDoc;
16 import org.omg.CORBA.portable.InputStream JavaDoc;
17 import org.omg.CORBA.portable.OutputStream JavaDoc;
18 import org.omg.CORBA.portable.RemarshalException JavaDoc;
19 import org.omg.CORBA.portable.ResponseHandler JavaDoc;
20 import org.omg.CORBA.portable.ServantObject JavaDoc;
21
22
23 public class _Coordinator_Stub extends Stub JavaDoc implements Coordinator {
24     
25     private static final String JavaDoc[] _type_ids = {
26         "RMI:org.objectweb.jotm.Coordinator:0000000000000000"
27     };
28     
29     public String JavaDoc[] _ids() {
30         return _type_ids;
31     }
32     
33     public int get_status() throws RemoteException JavaDoc {
34         if (!Util.isLocal(this)) {
35             try {
36                 org.omg.CORBA.portable.InputStream JavaDoc in = null;
37                 try {
38                     OutputStream JavaDoc out = _request("_get_J_status", true);
39                     in = _invoke(out);
40                     return in.read_long();
41                 } catch (ApplicationException JavaDoc ex) {
42                     in = ex.getInputStream();
43                     String JavaDoc id = in.read_string();
44                     throw new UnexpectedException JavaDoc(id);
45                 } catch (RemarshalException JavaDoc ex) {
46                     return get_status();
47                 } finally {
48                     _releaseReply(in);
49                 }
50             } catch (SystemException JavaDoc ex) {
51                 throw Util.mapSystemException(ex);
52             }
53         } else {
54             ServantObject JavaDoc so = _servant_preinvoke("_get_J_status",Coordinator.class);
55             if (so == null) {
56                 return get_status();
57             }
58             try {
59                 return ((Coordinator)so.servant).get_status();
60             } catch (Throwable JavaDoc ex) {
61                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
62                 throw Util.wrapException(exCopy);
63             } finally {
64                 _servant_postinvoke(so);
65             }
66         }
67     }
68     
69     public boolean is_same_transaction(Coordinator arg0) throws RemoteException JavaDoc {
70         if (!Util.isLocal(this)) {
71             try {
72                 org.omg.CORBA.portable.InputStream JavaDoc in = null;
73                 try {
74                     OutputStream JavaDoc out = _request("is_same_transaction", true);
75                     Util.writeRemoteObject(out,arg0);
76                     in = _invoke(out);
77                     return in.read_boolean();
78                 } catch (ApplicationException JavaDoc ex) {
79                     in = ex.getInputStream();
80                     String JavaDoc id = in.read_string();
81                     throw new UnexpectedException JavaDoc(id);
82                 } catch (RemarshalException JavaDoc ex) {
83                     return is_same_transaction(arg0);
84                 } finally {
85                     _releaseReply(in);
86                 }
87             } catch (SystemException JavaDoc ex) {
88                 throw Util.mapSystemException(ex);
89             }
90         } else {
91             ServantObject JavaDoc so = _servant_preinvoke("is_same_transaction",Coordinator.class);
92             if (so == null) {
93                 return is_same_transaction(arg0);
94             }
95             try {
96                 Coordinator arg0Copy = (Coordinator) Util.copyObject(arg0,_orb());
97                 return ((Coordinator)so.servant).is_same_transaction(arg0Copy);
98             } catch (Throwable JavaDoc ex) {
99                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
100                 throw Util.wrapException(exCopy);
101             } finally {
102                 _servant_postinvoke(so);
103             }
104         }
105     }
106     
107     public RecoveryCoordinator register_resource(Resource arg0) throws RemoteException JavaDoc {
108         if (!Util.isLocal(this)) {
109             try {
110                 org.omg.CORBA.portable.InputStream JavaDoc in = null;
111                 try {
112                     OutputStream JavaDoc out = _request("register_resource", true);
113                     Util.writeRemoteObject(out,arg0);
114                     in = _invoke(out);
115                     return (RecoveryCoordinator) PortableRemoteObject.narrow(in.read_Object(), RecoveryCoordinator.class);
116                 } catch (ApplicationException JavaDoc ex) {
117                     in = ex.getInputStream();
118                     String JavaDoc id = in.read_string();
119                     throw new UnexpectedException JavaDoc(id);
120                 } catch (RemarshalException JavaDoc ex) {
121                     return register_resource(arg0);
122                 } finally {
123                     _releaseReply(in);
124                 }
125             } catch (SystemException JavaDoc ex) {
126                 throw Util.mapSystemException(ex);
127             }
128         } else {
129             ServantObject JavaDoc so = _servant_preinvoke("register_resource",Coordinator.class);
130             if (so == null) {
131                 return register_resource(arg0);
132             }
133             try {
134                 Resource arg0Copy = (Resource) Util.copyObject(arg0,_orb());
135                 RecoveryCoordinator result = ((Coordinator)so.servant).register_resource(arg0Copy);
136                 return (RecoveryCoordinator)Util.copyObject(result,_orb());
137             } catch (Throwable JavaDoc ex) {
138                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
139                 throw Util.wrapException(exCopy);
140             } finally {
141                 _servant_postinvoke(so);
142             }
143         }
144     }
145     
146     public void register_synchronization(RemoteSynchro arg0) throws RemoteException JavaDoc {
147         if (!Util.isLocal(this)) {
148             try {
149                 org.omg.CORBA.portable.InputStream JavaDoc in = null;
150                 try {
151                     OutputStream JavaDoc out = _request("register_synchronization", true);
152                     Util.writeRemoteObject(out,arg0);
153                     _invoke(out);
154                 } catch (ApplicationException JavaDoc ex) {
155                     in = ex.getInputStream();
156                     String JavaDoc id = in.read_string();
157                     throw new UnexpectedException JavaDoc(id);
158                 } catch (RemarshalException JavaDoc ex) {
159                     register_synchronization(arg0);
160                 } finally {
161                     _releaseReply(in);
162                 }
163             } catch (SystemException JavaDoc ex) {
164                 throw Util.mapSystemException(ex);
165             }
166         } else {
167             ServantObject JavaDoc so = _servant_preinvoke("register_synchronization",Coordinator.class);
168             if (so == null) {
169                 register_synchronization(arg0);
170                 return ;
171             }
172             try {
173                 RemoteSynchro arg0Copy = (RemoteSynchro) Util.copyObject(arg0,_orb());
174                 ((Coordinator)so.servant).register_synchronization(arg0Copy);
175             } catch (Throwable JavaDoc ex) {
176                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
177                 throw Util.wrapException(exCopy);
178             } finally {
179                 _servant_postinvoke(so);
180             }
181         }
182     }
183     
184     public void rollback_only() throws RemoteException JavaDoc {
185         if (!Util.isLocal(this)) {
186             try {
187                 org.omg.CORBA.portable.InputStream JavaDoc in = null;
188                 try {
189                     OutputStream JavaDoc out = _request("rollback_only", true);
190                     _invoke(out);
191                 } catch (ApplicationException JavaDoc ex) {
192                     in = ex.getInputStream();
193                     String JavaDoc id = in.read_string();
194                     throw new UnexpectedException JavaDoc(id);
195                 } catch (RemarshalException JavaDoc ex) {
196                     rollback_only();
197                 } finally {
198                     _releaseReply(in);
199                 }
200             } catch (SystemException JavaDoc ex) {
201                 throw Util.mapSystemException(ex);
202             }
203         } else {
204             ServantObject JavaDoc so = _servant_preinvoke("rollback_only",Coordinator.class);
205             if (so == null) {
206                 rollback_only();
207                 return ;
208             }
209             try {
210                 ((Coordinator)so.servant).rollback_only();
211             } catch (Throwable JavaDoc ex) {
212                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
213                 throw Util.wrapException(exCopy);
214             } finally {
215                 _servant_postinvoke(so);
216             }
217         }
218     }
219     
220     public String JavaDoc get_transaction_name() throws RemoteException JavaDoc {
221         if (!Util.isLocal(this)) {
222             try {
223                 org.omg.CORBA_2_3.portable.InputStream JavaDoc in = null;
224                 try {
225                     OutputStream JavaDoc out = _request("_get_J_transaction_name", true);
226                     in = (org.omg.CORBA_2_3.portable.InputStream JavaDoc)_invoke(out);
227                     return (String JavaDoc) in.read_value(String JavaDoc.class);
228                 } catch (ApplicationException JavaDoc ex) {
229                     in = (org.omg.CORBA_2_3.portable.InputStream JavaDoc) ex.getInputStream();
230                     String JavaDoc id = in.read_string();
231                     throw new UnexpectedException JavaDoc(id);
232                 } catch (RemarshalException JavaDoc ex) {
233                     return get_transaction_name();
234                 } finally {
235                     _releaseReply(in);
236                 }
237             } catch (SystemException JavaDoc ex) {
238                 throw Util.mapSystemException(ex);
239             }
240         } else {
241             ServantObject JavaDoc so = _servant_preinvoke("_get_J_transaction_name",Coordinator.class);
242             if (so == null) {
243                 return get_transaction_name();
244             }
245             try {
246                 return ((Coordinator)so.servant).get_transaction_name();
247             } catch (Throwable JavaDoc ex) {
248                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
249                 throw Util.wrapException(exCopy);
250             } finally {
251                 _servant_postinvoke(so);
252             }
253         }
254     }
255 }
256
Popular Tags