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 org.omg.CORBA.ORB ; 13 import org.omg.CORBA.SystemException ; 14 import org.omg.CORBA.portable.ApplicationException ; 15 import org.omg.CORBA.portable.InputStream ; 16 import org.omg.CORBA.portable.OutputStream ; 17 import org.omg.CORBA.portable.RemarshalException ; 18 import org.omg.CORBA.portable.ResponseHandler ; 19 import org.omg.CORBA.portable.ServantObject ; 20 21 22 public class _Terminator_Stub extends Stub implements Terminator { 23 24 private static final String [] _type_ids = { 25 "RMI:org.objectweb.jotm.Terminator:0000000000000000" 26 }; 27 28 public String [] _ids() { 29 return _type_ids; 30 } 31 32 public void commit(boolean arg0) throws RemoteException { 33 if (!Util.isLocal(this)) { 34 try { 35 org.omg.CORBA.portable.InputStream in = null; 36 try { 37 OutputStream out = _request("commit", true); 38 out.write_boolean(arg0); 39 _invoke(out); 40 } catch (ApplicationException ex) { 41 in = ex.getInputStream(); 42 String id = in.read_string(); 43 throw new UnexpectedException (id); 44 } catch (RemarshalException ex) { 45 commit(arg0); 46 } finally { 47 _releaseReply(in); 48 } 49 } catch (SystemException ex) { 50 throw Util.mapSystemException(ex); 51 } 52 } else { 53 ServantObject so = _servant_preinvoke("commit",Terminator .class); 54 if (so == null) { 55 commit(arg0); 56 return ; 57 } 58 try { 59 ((Terminator )so.servant).commit(arg0); 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 void rollback() throws RemoteException { 70 if (!Util.isLocal(this)) { 71 try { 72 org.omg.CORBA.portable.InputStream in = null; 73 try { 74 OutputStream out = _request("rollback", true); 75 _invoke(out); 76 } catch (ApplicationException ex) { 77 in = ex.getInputStream(); 78 String id = in.read_string(); 79 throw new UnexpectedException (id); 80 } catch (RemarshalException ex) { 81 rollback(); 82 } finally { 83 _releaseReply(in); 84 } 85 } catch (SystemException ex) { 86 throw Util.mapSystemException(ex); 87 } 88 } else { 89 ServantObject so = _servant_preinvoke("rollback",Terminator .class); 90 if (so == null) { 91 rollback(); 92 return ; 93 } 94 try { 95 ((Terminator )so.servant).rollback(); 96 } catch (Throwable ex) { 97 Throwable exCopy = (Throwable )Util.copyObject(ex,_orb()); 98 throw Util.wrapException(exCopy); 99 } finally { 100 _servant_postinvoke(so); 101 } 102 } 103 } 104 } 105 | Popular Tags |