KickJava   Java API By Example, From Geeks To Geeks.

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


1 // Tie 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 javax.rmi.CORBA.Tie JavaDoc;
10 import javax.rmi.CORBA.Util JavaDoc;
11 import javax.rmi.PortableRemoteObject JavaDoc;
12 import org.omg.CORBA.BAD_OPERATION JavaDoc;
13 import org.omg.CORBA.ORB JavaDoc;
14 import org.omg.CORBA.SystemException JavaDoc;
15 import org.omg.CORBA.portable.InputStream JavaDoc;
16 import org.omg.CORBA.portable.OutputStream JavaDoc;
17 import org.omg.CORBA.portable.ResponseHandler JavaDoc;
18 import org.omg.CORBA.portable.UnknownException JavaDoc;
19 import org.omg.CORBA_2_3.portable.ObjectImpl JavaDoc;
20
21
22 public class _ControlImpl_Tie extends ObjectImpl JavaDoc implements Tie JavaDoc {
23     
24     private ControlImpl target = null;
25     
26     private static final String JavaDoc[] _type_ids = {
27         "RMI:org.objectweb.jotm.ControlImpl:0000000000000000",
28         "RMI:org.objectweb.jotm.Control:0000000000000000",
29         "RMI:org.objectweb.jotm.Resource:0000000000000000",
30         "RMI:org.objectweb.jotm.Coordinator:0000000000000000",
31         "RMI:org.objectweb.jotm.Terminator:0000000000000000",
32         "RMI:org.objectweb.jotm.RecoveryCoordinator:0000000000000000"
33     };
34     
35     public void setTarget(Remote JavaDoc target) {
36         this.target = (ControlImpl) target;
37     }
38     
39     public Remote JavaDoc getTarget() {
40         return target;
41     }
42     
43     public org.omg.CORBA.Object JavaDoc thisObject() {
44         return this;
45     }
46     
47     public void deactivate() {
48         _orb().disconnect(this);
49         _set_delegate(null);
50         target = null;
51     }
52     
53     public ORB JavaDoc orb() {
54         return _orb();
55     }
56     
57     public void orb(ORB JavaDoc orb) {
58         orb.connect(this);
59     }
60     
61     public String JavaDoc[] _ids() {
62         return _type_ids;
63     }
64     
65     public OutputStream JavaDoc _invoke(String JavaDoc method, InputStream JavaDoc _in, ResponseHandler JavaDoc reply) throws SystemException JavaDoc {
66         try {
67             org.omg.CORBA_2_3.portable.InputStream JavaDoc in =
68                 (org.omg.CORBA_2_3.portable.InputStream JavaDoc) _in;
69             switch (method.length()) {
70                 case 6:
71                     if (method.equals("forget")) {
72                         target.forget();
73                         OutputStream JavaDoc out = reply.createReply();
74                         return out;
75                     }
76                 case 7:
77                     if (method.equals("prepare")) {
78                         int result = target.prepare();
79                         OutputStream JavaDoc out = reply.createReply();
80                         out.write_long(result);
81                         return out;
82                     }
83                 case 8:
84                     if (method.equals("rollback")) {
85                         target.rollback();
86                         OutputStream JavaDoc out = reply.createReply();
87                         return out;
88                     } else if (method.equals("commit__")) {
89                         target.commit();
90                         OutputStream JavaDoc out = reply.createReply();
91                         return out;
92                     }
93                 case 13:
94                     if (method.equals("_get_J_status")) {
95                         int result = target.get_status();
96                         OutputStream JavaDoc out = reply.createReply();
97                         out.write_long(result);
98                         return out;
99                     } else if (method.equals("rollback_only")) {
100                         target.rollback_only();
101                         OutputStream JavaDoc out = reply.createReply();
102                         return out;
103                     }
104                 case 15:
105                     if (method.equals("commit__boolean")) {
106                         boolean arg0 = in.read_boolean();
107                         target.commit(arg0);
108                         OutputStream JavaDoc out = reply.createReply();
109                         return out;
110                     }
111                 case 16:
112                     if (method.equals("commit_one_phase")) {
113                         target.commit_one_phase();
114                         OutputStream JavaDoc out = reply.createReply();
115                         return out;
116                     }
117                 case 17:
118                     if (method.equals("register_resource")) {
119                         Resource arg0 = (Resource) PortableRemoteObject.narrow(in.read_Object(), Resource.class);
120                         RecoveryCoordinator result = target.register_resource(arg0);
121                         OutputStream JavaDoc out = reply.createReply();
122                         Util.writeRemoteObject(out,result);
123                         return out;
124                     } else if (method.equals("replay_completion")) {
125                         Resource arg0 = (Resource) PortableRemoteObject.narrow(in.read_Object(), Resource.class);
126                         int result = target.replay_completion(arg0);
127                         OutputStream JavaDoc out = reply.createReply();
128                         out.write_long(result);
129                         return out;
130                     } else if (method.equals("_get_J_terminator")) {
131                         Terminator JavaDoc result = target.get_terminator();
132                         OutputStream JavaDoc out = reply.createReply();
133                         Util.writeRemoteObject(out,result);
134                         return out;
135                     }
136                 case 18:
137                     if (method.equals("_get_J_coordinator")) {
138                         Coordinator result = target.get_coordinator();
139                         OutputStream JavaDoc out = reply.createReply();
140                         Util.writeRemoteObject(out,result);
141                         return out;
142                     }
143                 case 19:
144                     if (method.equals("is_same_transaction")) {
145                         Coordinator arg0 = (Coordinator) PortableRemoteObject.narrow(in.read_Object(), Coordinator.class);
146                         boolean result = target.is_same_transaction(arg0);
147                         OutputStream JavaDoc out = reply.createReply();
148                         out.write_boolean(result);
149                         return out;
150                     }
151                 case 23:
152                     if (method.equals("_get_J_transaction_name")) {
153                         String JavaDoc result = target.get_transaction_name();
154                         org.omg.CORBA_2_3.portable.OutputStream JavaDoc out =
155                             (org.omg.CORBA_2_3.portable.OutputStream JavaDoc) reply.createReply();
156                         out.write_value(result,String JavaDoc.class);
157                         return out;
158                     }
159                 case 24:
160                     if (method.equals("register_synchronization")) {
161                         RemoteSynchro arg0 = (RemoteSynchro) PortableRemoteObject.narrow(in.read_Object(), RemoteSynchro.class);
162                         target.register_synchronization(arg0);
163                         OutputStream JavaDoc out = reply.createReply();
164                         return out;
165                     }
166             }
167             throw new BAD_OPERATION JavaDoc();
168         } catch (SystemException JavaDoc ex) {
169             throw ex;
170         } catch (Throwable JavaDoc ex) {
171             throw new UnknownException JavaDoc(ex);
172         }
173     }
174 }
175
Popular Tags