KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jotm > _Terminator_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 _Terminator_Stub extends Stub JavaDoc implements Terminator JavaDoc {
23     
24     private static final String JavaDoc[] _type_ids = {
25         "RMI:org.objectweb.jotm.Terminator:0000000000000000"
26     };
27     
28     public String JavaDoc[] _ids() {
29         return _type_ids;
30     }
31     
32     public void commit(boolean arg0) 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("commit", true);
38                     out.write_boolean(arg0);
39                     _invoke(out);
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                     commit(arg0);
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("commit",Terminator JavaDoc.class);
54             if (so == null) {
55                 commit(arg0);
56                 return ;
57             }
58             try {
59                 ((Terminator JavaDoc)so.servant).commit(arg0);
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 void rollback() 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("rollback", true);
75                     _invoke(out);
76                 } catch (ApplicationException JavaDoc ex) {
77                     in = ex.getInputStream();
78                     String JavaDoc id = in.read_string();
79                     throw new UnexpectedException JavaDoc(id);
80                 } catch (RemarshalException JavaDoc ex) {
81                     rollback();
82                 } finally {
83                     _releaseReply(in);
84                 }
85             } catch (SystemException JavaDoc ex) {
86                 throw Util.mapSystemException(ex);
87             }
88         } else {
89             ServantObject JavaDoc so = _servant_preinvoke("rollback",Terminator JavaDoc.class);
90             if (so == null) {
91                 rollback();
92                 return ;
93             }
94             try {
95                 ((Terminator JavaDoc)so.servant).rollback();
96             } catch (Throwable JavaDoc ex) {
97                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
98                 throw Util.wrapException(exCopy);
99             } finally {
100                 _servant_postinvoke(so);
101             }
102         }
103     }
104 }
105
Popular Tags