KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jotm > _Resource_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 org.omg.CORBA.ORB JavaDoc;
13 import org.omg.CORBA.SystemException JavaDoc;
14 import org.omg.CORBA.portable.ApplicationException JavaDoc;
15 import org.omg.CORBA.portable.InputStream JavaDoc;
16 import org.omg.CORBA.portable.OutputStream JavaDoc;
17 import org.omg.CORBA.portable.RemarshalException JavaDoc;
18 import org.omg.CORBA.portable.ResponseHandler JavaDoc;
19 import org.omg.CORBA.portable.ServantObject JavaDoc;
20
21
22 public class _Resource_Stub extends Stub JavaDoc implements Resource {
23     
24     private static final String JavaDoc[] _type_ids = {
25         "RMI:org.objectweb.jotm.Resource:0000000000000000"
26     };
27     
28     public String JavaDoc[] _ids() {
29         return _type_ids;
30     }
31     
32     public int prepare() throws RemoteException JavaDoc {
33         if (!Util.isLocal(this)) {
34             try {
35                 org.omg.CORBA.portable.InputStream JavaDoc in = null;
36                 try {
37                     OutputStream JavaDoc out = _request("prepare", true);
38                     in = _invoke(out);
39                     return in.read_long();
40                 } catch (ApplicationException JavaDoc ex) {
41                     in = ex.getInputStream();
42                     String JavaDoc id = in.read_string();
43                     throw new UnexpectedException JavaDoc(id);
44                 } catch (RemarshalException JavaDoc ex) {
45                     return prepare();
46                 } finally {
47                     _releaseReply(in);
48                 }
49             } catch (SystemException JavaDoc ex) {
50                 throw Util.mapSystemException(ex);
51             }
52         } else {
53             ServantObject JavaDoc so = _servant_preinvoke("prepare",Resource.class);
54             if (so == null) {
55                 return prepare();
56             }
57             try {
58                 return ((Resource)so.servant).prepare();
59             } catch (Throwable JavaDoc ex) {
60                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
61                 throw Util.wrapException(exCopy);
62             } finally {
63                 _servant_postinvoke(so);
64             }
65         }
66     }
67     
68     public void rollback() throws RemoteException JavaDoc {
69         if (!Util.isLocal(this)) {
70             try {
71                 org.omg.CORBA.portable.InputStream JavaDoc in = null;
72                 try {
73                     OutputStream JavaDoc out = _request("rollback", true);
74                     _invoke(out);
75                 } catch (ApplicationException JavaDoc ex) {
76                     in = ex.getInputStream();
77                     String JavaDoc id = in.read_string();
78                     throw new UnexpectedException JavaDoc(id);
79                 } catch (RemarshalException JavaDoc ex) {
80                     rollback();
81                 } finally {
82                     _releaseReply(in);
83                 }
84             } catch (SystemException JavaDoc ex) {
85                 throw Util.mapSystemException(ex);
86             }
87         } else {
88             ServantObject JavaDoc so = _servant_preinvoke("rollback",Resource.class);
89             if (so == null) {
90                 rollback();
91                 return ;
92             }
93             try {
94                 ((Resource)so.servant).rollback();
95             } catch (Throwable JavaDoc ex) {
96                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
97                 throw Util.wrapException(exCopy);
98             } finally {
99                 _servant_postinvoke(so);
100             }
101         }
102     }
103     
104     public void commit() throws RemoteException JavaDoc {
105         if (!Util.isLocal(this)) {
106             try {
107                 org.omg.CORBA.portable.InputStream JavaDoc in = null;
108                 try {
109                     OutputStream JavaDoc out = _request("commit", true);
110                     _invoke(out);
111                 } catch (ApplicationException JavaDoc ex) {
112                     in = ex.getInputStream();
113                     String JavaDoc id = in.read_string();
114                     throw new UnexpectedException JavaDoc(id);
115                 } catch (RemarshalException JavaDoc ex) {
116                     commit();
117                 } finally {
118                     _releaseReply(in);
119                 }
120             } catch (SystemException JavaDoc ex) {
121                 throw Util.mapSystemException(ex);
122             }
123         } else {
124             ServantObject JavaDoc so = _servant_preinvoke("commit",Resource.class);
125             if (so == null) {
126                 commit();
127                 return ;
128             }
129             try {
130                 ((Resource)so.servant).commit();
131             } catch (Throwable JavaDoc ex) {
132                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
133                 throw Util.wrapException(exCopy);
134             } finally {
135                 _servant_postinvoke(so);
136             }
137         }
138     }
139     
140     public void commit_one_phase() throws RemoteException JavaDoc {
141         if (!Util.isLocal(this)) {
142             try {
143                 org.omg.CORBA.portable.InputStream JavaDoc in = null;
144                 try {
145                     OutputStream JavaDoc out = _request("commit_one_phase", true);
146                     _invoke(out);
147                 } catch (ApplicationException JavaDoc ex) {
148                     in = ex.getInputStream();
149                     String JavaDoc id = in.read_string();
150                     throw new UnexpectedException JavaDoc(id);
151                 } catch (RemarshalException JavaDoc ex) {
152                     commit_one_phase();
153                 } finally {
154                     _releaseReply(in);
155                 }
156             } catch (SystemException JavaDoc ex) {
157                 throw Util.mapSystemException(ex);
158             }
159         } else {
160             ServantObject JavaDoc so = _servant_preinvoke("commit_one_phase",Resource.class);
161             if (so == null) {
162                 commit_one_phase();
163                 return ;
164             }
165             try {
166                 ((Resource)so.servant).commit_one_phase();
167             } catch (Throwable JavaDoc ex) {
168                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
169                 throw Util.wrapException(exCopy);
170             } finally {
171                 _servant_postinvoke(so);
172             }
173         }
174     }
175     
176     public void forget() throws RemoteException JavaDoc {
177         if (!Util.isLocal(this)) {
178             try {
179                 org.omg.CORBA.portable.InputStream JavaDoc in = null;
180                 try {
181                     OutputStream JavaDoc out = _request("forget", true);
182                     _invoke(out);
183                 } catch (ApplicationException JavaDoc ex) {
184                     in = ex.getInputStream();
185                     String JavaDoc id = in.read_string();
186                     throw new UnexpectedException JavaDoc(id);
187                 } catch (RemarshalException JavaDoc ex) {
188                     forget();
189                 } finally {
190                     _releaseReply(in);
191                 }
192             } catch (SystemException JavaDoc ex) {
193                 throw Util.mapSystemException(ex);
194             }
195         } else {
196             ServantObject JavaDoc so = _servant_preinvoke("forget",Resource.class);
197             if (so == null) {
198                 forget();
199                 return ;
200             }
201             try {
202                 ((Resource)so.servant).forget();
203             } catch (Throwable JavaDoc ex) {
204                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
205                 throw Util.wrapException(exCopy);
206             } finally {
207                 _servant_postinvoke(so);
208             }
209         }
210     }
211 }
212
Popular Tags