1 4 package org.objectweb.jotm; 5 6 import java.io.Serializable ; 7 import java.rmi.Remote ; 8 import java.rmi.RemoteException ; 9 import javax.rmi.CORBA.Tie ; 10 import javax.rmi.CORBA.Util ; 11 import javax.rmi.PortableRemoteObject ; 12 import org.omg.CORBA.BAD_OPERATION ; 13 import org.omg.CORBA.ORB ; 14 import org.omg.CORBA.SystemException ; 15 import org.omg.CORBA.portable.InputStream ; 16 import org.omg.CORBA.portable.OutputStream ; 17 import org.omg.CORBA.portable.ResponseHandler ; 18 import org.omg.CORBA.portable.UnknownException ; 19 import org.omg.CORBA_2_3.portable.ObjectImpl ; 20 21 22 public class _TransactionFactoryImpl_Tie extends ObjectImpl implements Tie { 23 24 private TransactionFactoryImpl target = null; 25 26 private static final String [] _type_ids = { 27 "RMI:org.objectweb.jotm.TransactionFactory:0000000000000000" 28 }; 29 30 public void setTarget(Remote target) { 31 this.target = (TransactionFactoryImpl) target; 32 } 33 34 public Remote getTarget() { 35 return target; 36 } 37 38 public org.omg.CORBA.Object thisObject() { 39 return this; 40 } 41 42 public void deactivate() { 43 _orb().disconnect(this); 44 _set_delegate(null); 45 target = null; 46 } 47 48 public ORB orb() { 49 return _orb(); 50 } 51 52 public void orb(ORB orb) { 53 orb.connect(this); 54 } 55 56 public String [] _ids() { 57 return _type_ids; 58 } 59 60 public OutputStream _invoke(String method, InputStream _in, ResponseHandler reply) throws SystemException { 61 try { 62 org.omg.CORBA_2_3.portable.InputStream in = 63 (org.omg.CORBA_2_3.portable.InputStream ) _in; 64 switch (method.length()) { 65 case 6: 66 if (method.equals("create")) { 67 int arg0 = in.read_long(); 68 Control result = target.create(arg0); 69 OutputStream out = reply.createReply(); 70 Util.writeRemoteObject(out,result); 71 return out; 72 } 73 case 8: 74 if (method.equals("recreate")) { 75 TransactionContext arg0 = (TransactionContext) in.read_value(TransactionContext.class); 76 Control result = target.recreate(arg0); 77 OutputStream out = reply.createReply(); 78 Util.writeRemoteObject(out,result); 79 return out; 80 } 81 case 13: 82 if (method.equals("_get_hostName")) { 83 String result = target.getHostName(); 84 org.omg.CORBA_2_3.portable.OutputStream out = 85 (org.omg.CORBA_2_3.portable.OutputStream ) reply.createReply(); 86 out.write_value(result,String .class); 87 return out; 88 } 89 case 15: 90 if (method.equals("_get_portNumber")) { 91 int result = target.getPortNumber(); 92 OutputStream out = reply.createReply(); 93 out.write_long(result); 94 return out; 95 } 96 } 97 throw new BAD_OPERATION (); 98 } catch (SystemException ex) { 99 throw ex; 100 } catch (Throwable ex) { 101 throw new UnknownException (ex); 102 } 103 } 104 } 105 | Popular Tags |