KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jotm > _SubCoordinator_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 org.omg.CORBA.BAD_OPERATION JavaDoc;
12 import org.omg.CORBA.ORB JavaDoc;
13 import org.omg.CORBA.SystemException JavaDoc;
14 import org.omg.CORBA.portable.InputStream JavaDoc;
15 import org.omg.CORBA.portable.OutputStream JavaDoc;
16 import org.omg.CORBA.portable.ResponseHandler JavaDoc;
17 import org.omg.CORBA.portable.UnknownException JavaDoc;
18 import org.omg.CORBA_2_3.portable.ObjectImpl JavaDoc;
19
20
21 public class _SubCoordinator_Tie extends ObjectImpl JavaDoc implements Tie JavaDoc {
22     
23     private SubCoordinator target = null;
24     
25     private static final String JavaDoc[] _type_ids = {
26         "RMI:org.objectweb.jotm.Resource:0000000000000000"
27     };
28     
29     public void setTarget(Remote JavaDoc target) {
30         this.target = (SubCoordinator) target;
31     }
32     
33     public Remote JavaDoc getTarget() {
34         return target;
35     }
36     
37     public org.omg.CORBA.Object JavaDoc thisObject() {
38         return this;
39     }
40     
41     public void deactivate() {
42         _orb().disconnect(this);
43         _set_delegate(null);
44         target = null;
45     }
46     
47     public ORB JavaDoc orb() {
48         return _orb();
49     }
50     
51     public void orb(ORB JavaDoc orb) {
52         orb.connect(this);
53     }
54     
55     public String JavaDoc[] _ids() {
56         return _type_ids;
57     }
58     
59     public OutputStream JavaDoc _invoke(String JavaDoc method, InputStream JavaDoc _in, ResponseHandler JavaDoc reply) throws SystemException JavaDoc {
60         try {
61             org.omg.CORBA_2_3.portable.InputStream JavaDoc in =
62                 (org.omg.CORBA_2_3.portable.InputStream JavaDoc) _in;
63             switch (method.length()) {
64                 case 6:
65                     if (method.equals("commit")) {
66                         target.commit();
67                         OutputStream JavaDoc out = reply.createReply();
68                         return out;
69                     } else if (method.equals("forget")) {
70                         target.forget();
71                         OutputStream JavaDoc out = reply.createReply();
72                         return out;
73                     }
74                 case 7:
75                     if (method.equals("prepare")) {
76                         int result = target.prepare();
77                         OutputStream JavaDoc out = reply.createReply();
78                         out.write_long(result);
79                         return out;
80                     }
81                 case 8:
82                     if (method.equals("rollback")) {
83                         target.rollback();
84                         OutputStream JavaDoc out = reply.createReply();
85                         return out;
86                     }
87                 case 16:
88                     if (method.equals("commit_one_phase")) {
89                         target.commit_one_phase();
90                         OutputStream JavaDoc out = reply.createReply();
91                         return out;
92                     }
93             }
94             throw new BAD_OPERATION JavaDoc();
95         } catch (SystemException JavaDoc ex) {
96             throw ex;
97         } catch (Throwable JavaDoc ex) {
98             throw new UnknownException JavaDoc(ex);
99         }
100     }
101 }
102
Popular Tags