KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jotm > _TransactionFactory_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 _TransactionFactory_Stub extends Stub JavaDoc implements TransactionFactory {
24     
25     private static final String JavaDoc[] _type_ids = {
26         "RMI:org.objectweb.jotm.TransactionFactory:0000000000000000"
27     };
28     
29     public String JavaDoc[] _ids() {
30         return _type_ids;
31     }
32     
33     public Control create(int arg0) 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("create", true);
39                     out.write_long(arg0);
40                     in = _invoke(out);
41                     return (Control) PortableRemoteObject.narrow(in.read_Object(), Control.class);
42                 } catch (ApplicationException JavaDoc ex) {
43                     in = ex.getInputStream();
44                     String JavaDoc id = in.read_string();
45                     throw new UnexpectedException JavaDoc(id);
46                 } catch (RemarshalException JavaDoc ex) {
47                     return create(arg0);
48                 } finally {
49                     _releaseReply(in);
50                 }
51             } catch (SystemException JavaDoc ex) {
52                 throw Util.mapSystemException(ex);
53             }
54         } else {
55             ServantObject JavaDoc so = _servant_preinvoke("create",TransactionFactory.class);
56             if (so == null) {
57                 return create(arg0);
58             }
59             try {
60                 Control result = ((TransactionFactory)so.servant).create(arg0);
61                 return (Control)Util.copyObject(result,_orb());
62             } catch (Throwable JavaDoc ex) {
63                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
64                 throw Util.wrapException(exCopy);
65             } finally {
66                 _servant_postinvoke(so);
67             }
68         }
69     }
70     
71     public Control recreate(TransactionContext arg0) throws RemoteException JavaDoc {
72         if (!Util.isLocal(this)) {
73             try {
74                 org.omg.CORBA_2_3.portable.InputStream JavaDoc in = null;
75                 try {
76                     org.omg.CORBA_2_3.portable.OutputStream JavaDoc out =
77                         (org.omg.CORBA_2_3.portable.OutputStream JavaDoc)
78                         _request("recreate", true);
79                     out.write_value((Serializable JavaDoc)arg0,TransactionContext.class);
80                     in = (org.omg.CORBA_2_3.portable.InputStream JavaDoc)_invoke(out);
81                     return (Control) PortableRemoteObject.narrow(in.read_Object(), Control.class);
82                 } catch (ApplicationException JavaDoc ex) {
83                     in = (org.omg.CORBA_2_3.portable.InputStream JavaDoc) ex.getInputStream();
84                     String JavaDoc id = in.read_string();
85                     throw new UnexpectedException JavaDoc(id);
86                 } catch (RemarshalException JavaDoc ex) {
87                     return recreate(arg0);
88                 } finally {
89                     _releaseReply(in);
90                 }
91             } catch (SystemException JavaDoc ex) {
92                 throw Util.mapSystemException(ex);
93             }
94         } else {
95             ServantObject JavaDoc so = _servant_preinvoke("recreate",TransactionFactory.class);
96             if (so == null) {
97                 return recreate(arg0);
98             }
99             try {
100                 TransactionContext arg0Copy = (TransactionContext) Util.copyObject(arg0,_orb());
101                 Control result = ((TransactionFactory)so.servant).recreate(arg0Copy);
102                 return (Control)Util.copyObject(result,_orb());
103             } catch (Throwable JavaDoc ex) {
104                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
105                 throw Util.wrapException(exCopy);
106             } finally {
107                 _servant_postinvoke(so);
108             }
109         }
110     }
111     
112     public int getPortNumber() throws RemoteException JavaDoc {
113         if (!Util.isLocal(this)) {
114             try {
115                 org.omg.CORBA.portable.InputStream JavaDoc in = null;
116                 try {
117                     OutputStream JavaDoc out = _request("_get_portNumber", true);
118                     in = _invoke(out);
119                     return in.read_long();
120                 } catch (ApplicationException JavaDoc ex) {
121                     in = ex.getInputStream();
122                     String JavaDoc id = in.read_string();
123                     throw new UnexpectedException JavaDoc(id);
124                 } catch (RemarshalException JavaDoc ex) {
125                     return getPortNumber();
126                 } finally {
127                     _releaseReply(in);
128                 }
129             } catch (SystemException JavaDoc ex) {
130                 throw Util.mapSystemException(ex);
131             }
132         } else {
133             ServantObject JavaDoc so = _servant_preinvoke("_get_portNumber",TransactionFactory.class);
134             if (so == null) {
135                 return getPortNumber();
136             }
137             try {
138                 return ((TransactionFactory)so.servant).getPortNumber();
139             } catch (Throwable JavaDoc ex) {
140                 Throwable JavaDoc exCopy = (Throwable JavaDoc)Util.copyObject(ex,_orb());
141                 throw Util.wrapException(exCopy);
142             } finally {
143                 _servant_postinvoke(so);
144             }
145         }
146     }
147     
148     public String JavaDoc getHostName() throws RemoteException JavaDoc {
149         if (!Util.isLocal(this)) {
150             try {
151                 org.omg.CORBA_2_3.portable.InputStream JavaDoc in = null;
152                 try {
153                     OutputStream JavaDoc out = _request("_get_hostName", true);
154                     in = (org.omg.CORBA_2_3.portable.InputStream JavaDoc)_invoke(out);
155                     return (String JavaDoc) in.read_value(String JavaDoc.class);
156                 } catch (ApplicationException JavaDoc ex) {
157                     in = (org.omg.CORBA_2_3.portable.InputStream JavaDoc) ex.getInputStream();
158                     String JavaDoc id = in.read_string();
159                     throw new UnexpectedException JavaDoc(id);
160                 } catch (RemarshalException JavaDoc ex) {
161                     return getHostName();
162                 } finally {
163                     _releaseReply(in);
164                 }
165             } catch (SystemException JavaDoc ex) {
166                 throw Util.mapSystemException(ex);
167             }
168         } else {
169             ServantObject JavaDoc so = _servant_preinvoke("_get_hostName",TransactionFactory.class);
170             if (so == null) {
171                 return getHostName();
172             }
173             try {
174                 return ((TransactionFactory)so.servant).getHostName();
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
Popular Tags