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 _TransactionFactory_Stub extends Stub implements TransactionFactory { 24 25 private static final String [] _type_ids = { 26 "RMI:org.objectweb.jotm.TransactionFactory:0000000000000000" 27 }; 28 29 public String [] _ids() { 30 return _type_ids; 31 } 32 33 public Control create(int arg0) throws RemoteException { 34 if (!Util.isLocal(this)) { 35 try { 36 org.omg.CORBA.portable.InputStream in = null; 37 try { 38 OutputStream 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 ex) { 43 in = ex.getInputStream(); 44 String id = in.read_string(); 45 throw new UnexpectedException (id); 46 } catch (RemarshalException ex) { 47 return create(arg0); 48 } finally { 49 _releaseReply(in); 50 } 51 } catch (SystemException ex) { 52 throw Util.mapSystemException(ex); 53 } 54 } else { 55 ServantObject 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 ex) { 63 Throwable exCopy = (Throwable )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 { 72 if (!Util.isLocal(this)) { 73 try { 74 org.omg.CORBA_2_3.portable.InputStream in = null; 75 try { 76 org.omg.CORBA_2_3.portable.OutputStream out = 77 (org.omg.CORBA_2_3.portable.OutputStream ) 78 _request("recreate", true); 79 out.write_value((Serializable )arg0,TransactionContext.class); 80 in = (org.omg.CORBA_2_3.portable.InputStream )_invoke(out); 81 return (Control) PortableRemoteObject.narrow(in.read_Object(), Control.class); 82 } catch (ApplicationException ex) { 83 in = (org.omg.CORBA_2_3.portable.InputStream ) ex.getInputStream(); 84 String id = in.read_string(); 85 throw new UnexpectedException (id); 86 } catch (RemarshalException ex) { 87 return recreate(arg0); 88 } finally { 89 _releaseReply(in); 90 } 91 } catch (SystemException ex) { 92 throw Util.mapSystemException(ex); 93 } 94 } else { 95 ServantObject 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 ex) { 104 Throwable exCopy = (Throwable )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 { 113 if (!Util.isLocal(this)) { 114 try { 115 org.omg.CORBA.portable.InputStream in = null; 116 try { 117 OutputStream out = _request("_get_portNumber", true); 118 in = _invoke(out); 119 return in.read_long(); 120 } catch (ApplicationException ex) { 121 in = ex.getInputStream(); 122 String id = in.read_string(); 123 throw new UnexpectedException (id); 124 } catch (RemarshalException ex) { 125 return getPortNumber(); 126 } finally { 127 _releaseReply(in); 128 } 129 } catch (SystemException ex) { 130 throw Util.mapSystemException(ex); 131 } 132 } else { 133 ServantObject 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 ex) { 140 Throwable exCopy = (Throwable )Util.copyObject(ex,_orb()); 141 throw Util.wrapException(exCopy); 142 } finally { 143 _servant_postinvoke(so); 144 } 145 } 146 } 147 148 public String getHostName() throws RemoteException { 149 if (!Util.isLocal(this)) { 150 try { 151 org.omg.CORBA_2_3.portable.InputStream in = null; 152 try { 153 OutputStream out = _request("_get_hostName", true); 154 in = (org.omg.CORBA_2_3.portable.InputStream )_invoke(out); 155 return (String ) in.read_value(String .class); 156 } catch (ApplicationException ex) { 157 in = (org.omg.CORBA_2_3.portable.InputStream ) ex.getInputStream(); 158 String id = in.read_string(); 159 throw new UnexpectedException (id); 160 } catch (RemarshalException ex) { 161 return getHostName(); 162 } finally { 163 _releaseReply(in); 164 } 165 } catch (SystemException ex) { 166 throw Util.mapSystemException(ex); 167 } 168 } else { 169 ServantObject 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 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 | Popular Tags |