1 4 package org.objectweb.jotm; 5 6 import java.io.Serializable ; 7 import java.rmi.Remote ; 8 import java.rmi.RemoteException ; 9 import java.rmi.UnexpectedException ; 10 import javax.rmi.CORBA.Stub ; 11 import javax.rmi.CORBA.Util ; 12 import javax.rmi.PortableRemoteObject ; 13 import org.omg.CORBA.ORB ; 14 import org.omg.CORBA.SystemException ; 15 import org.omg.CORBA.portable.ApplicationException ; 16 import org.omg.CORBA.portable.InputStream ; 17 import org.omg.CORBA.portable.OutputStream ; 18 import org.omg.CORBA.portable.RemarshalException ; 19 import org.omg.CORBA.portable.ResponseHandler ; 20 import org.omg.CORBA.portable.ServantObject ; 21 22 23 public class _Coordinator_Stub extends Stub implements Coordinator { 24 25 private static final String [] _type_ids = { 26 "RMI:org.objectweb.jotm.Coordinator:0000000000000000" 27 }; 28 29 public String [] _ids() { 30 return _type_ids; 31 } 32 33 public int get_status() throws RemoteException { 34 if (!Util.isLocal(this)) { 35 try { 36 org.omg.CORBA.portable.InputStream in = null; 37 try { 38 OutputStream out = _request("_get_J_status", true); 39 in = _invoke(out); 40 return in.read_long(); 41 } catch (ApplicationException ex) { 42 in = ex.getInputStream(); 43 String id = in.read_string(); 44 throw new UnexpectedException (id); 45 } catch (RemarshalException ex) { 46 return get_status(); 47 } finally { 48 _releaseReply(in); 49 } 50 } catch (SystemException ex) { 51 throw Util.mapSystemException(ex); 52 } 53 } else { 54 ServantObject so = _servant_preinvoke("_get_J_status",Coordinator.class); 55 if (so == null) { 56 return get_status(); 57 } 58 try { 59 return ((Coordinator)so.servant).get_status(); 60 } catch (Throwable ex) { 61 Throwable exCopy = (Throwable )Util.copyObject(ex,_orb()); 62 throw Util.wrapException(exCopy); 63 } finally { 64 _servant_postinvoke(so); 65 } 66 } 67 } 68 69 public boolean is_same_transaction(Coordinator arg0) throws RemoteException { 70 if (!Util.isLocal(this)) { 71 try { 72 org.omg.CORBA.portable.InputStream in = null; 73 try { 74 OutputStream out = _request("is_same_transaction", true); 75 Util.writeRemoteObject(out,arg0); 76 in = _invoke(out); 77 return in.read_boolean(); 78 } catch (ApplicationException ex) { 79 in = ex.getInputStream(); 80 String id = in.read_string(); 81 throw new UnexpectedException (id); 82 } catch (RemarshalException ex) { 83 return is_same_transaction(arg0); 84 } finally { 85 _releaseReply(in); 86 } 87 } catch (SystemException ex) { 88 throw Util.mapSystemException(ex); 89 } 90 } else { 91 ServantObject so = _servant_preinvoke("is_same_transaction",Coordinator.class); 92 if (so == null) { 93 return is_same_transaction(arg0); 94 } 95 try { 96 Coordinator arg0Copy = (Coordinator) Util.copyObject(arg0,_orb()); 97 return ((Coordinator)so.servant).is_same_transaction(arg0Copy); 98 } catch (Throwable ex) { 99 Throwable exCopy = (Throwable )Util.copyObject(ex,_orb()); 100 throw Util.wrapException(exCopy); 101 } finally { 102 _servant_postinvoke(so); 103 } 104 } 105 } 106 107 public RecoveryCoordinator register_resource(Resource arg0) throws RemoteException { 108 if (!Util.isLocal(this)) { 109 try { 110 org.omg.CORBA.portable.InputStream in = null; 111 try { 112 OutputStream out = _request("register_resource", true); 113 Util.writeRemoteObject(out,arg0); 114 in = _invoke(out); 115 return (RecoveryCoordinator) PortableRemoteObject.narrow(in.read_Object(), RecoveryCoordinator.class); 116 } catch (ApplicationException ex) { 117 in = ex.getInputStream(); 118 String id = in.read_string(); 119 throw new UnexpectedException (id); 120 } catch (RemarshalException ex) { 121 return register_resource(arg0); 122 } finally { 123 _releaseReply(in); 124 } 125 } catch (SystemException ex) { 126 throw Util.mapSystemException(ex); 127 } 128 } else { 129 ServantObject so = _servant_preinvoke("register_resource",Coordinator.class); 130 if (so == null) { 131 return register_resource(arg0); 132 } 133 try { 134 Resource arg0Copy = (Resource) Util.copyObject(arg0,_orb()); 135 RecoveryCoordinator result = ((Coordinator)so.servant).register_resource(arg0Copy); 136 return (RecoveryCoordinator)Util.copyObject(result,_orb()); 137 } catch (Throwable ex) { 138 Throwable exCopy = (Throwable )Util.copyObject(ex,_orb()); 139 throw Util.wrapException(exCopy); 140 } finally { 141 _servant_postinvoke(so); 142 } 143 } 144 } 145 146 public void register_synchronization(RemoteSynchro arg0) throws RemoteException { 147 if (!Util.isLocal(this)) { 148 try { 149 org.omg.CORBA.portable.InputStream in = null; 150 try { 151 OutputStream out = _request("register_synchronization", true); 152 Util.writeRemoteObject(out,arg0); 153 _invoke(out); 154 } catch (ApplicationException ex) { 155 in = ex.getInputStream(); 156 String id = in.read_string(); 157 throw new UnexpectedException (id); 158 } catch (RemarshalException ex) { 159 register_synchronization(arg0); 160 } finally { 161 _releaseReply(in); 162 } 163 } catch (SystemException ex) { 164 throw Util.mapSystemException(ex); 165 } 166 } else { 167 ServantObject so = _servant_preinvoke("register_synchronization",Coordinator.class); 168 if (so == null) { 169 register_synchronization(arg0); 170 return ; 171 } 172 try { 173 RemoteSynchro arg0Copy = (RemoteSynchro) Util.copyObject(arg0,_orb()); 174 ((Coordinator)so.servant).register_synchronization(arg0Copy); 175 } catch (Throwable ex) { 176 Throwable exCopy = (Throwable )Util.copyObject(ex,_orb()); 177 throw Util.wrapException(exCopy); 178 } finally { 179 _servant_postinvoke(so); 180 } 181 } 182 } 183 184 public void rollback_only() throws RemoteException { 185 if (!Util.isLocal(this)) { 186 try { 187 org.omg.CORBA.portable.InputStream in = null; 188 try { 189 OutputStream out = _request("rollback_only", true); 190 _invoke(out); 191 } catch (ApplicationException ex) { 192 in = ex.getInputStream(); 193 String id = in.read_string(); 194 throw new UnexpectedException (id); 195 } catch (RemarshalException ex) { 196 rollback_only(); 197 } finally { 198 _releaseReply(in); 199 } 200 } catch (SystemException ex) { 201 throw Util.mapSystemException(ex); 202 } 203 } else { 204 ServantObject so = _servant_preinvoke("rollback_only",Coordinator.class); 205 if (so == null) { 206 rollback_only(); 207 return ; 208 } 209 try { 210 ((Coordinator)so.servant).rollback_only(); 211 } catch (Throwable ex) { 212 Throwable exCopy = (Throwable )Util.copyObject(ex,_orb()); 213 throw Util.wrapException(exCopy); 214 } finally { 215 _servant_postinvoke(so); 216 } 217 } 218 } 219 220 public String get_transaction_name() throws RemoteException { 221 if (!Util.isLocal(this)) { 222 try { 223 org.omg.CORBA_2_3.portable.InputStream in = null; 224 try { 225 OutputStream out = _request("_get_J_transaction_name", true); 226 in = (org.omg.CORBA_2_3.portable.InputStream )_invoke(out); 227 return (String ) in.read_value(String .class); 228 } catch (ApplicationException ex) { 229 in = (org.omg.CORBA_2_3.portable.InputStream ) ex.getInputStream(); 230 String id = in.read_string(); 231 throw new UnexpectedException (id); 232 } catch (RemarshalException ex) { 233 return get_transaction_name(); 234 } finally { 235 _releaseReply(in); 236 } 237 } catch (SystemException ex) { 238 throw Util.mapSystemException(ex); 239 } 240 } else { 241 ServantObject so = _servant_preinvoke("_get_J_transaction_name",Coordinator.class); 242 if (so == null) { 243 return get_transaction_name(); 244 } 245 try { 246 return ((Coordinator)so.servant).get_transaction_name(); 247 } catch (Throwable ex) { 248 Throwable exCopy = (Throwable )Util.copyObject(ex,_orb()); 249 throw Util.wrapException(exCopy); 250 } finally { 251 _servant_postinvoke(so); 252 } 253 } 254 } 255 } 256 | Popular Tags |