1 22 package org.jboss.tm.iiop; 23 24 import org.omg.CORBA.LocalObject ; 25 import org.omg.IOP.Codec ; 26 import org.omg.IOP.ENCODING_CDR_ENCAPS ; 27 import org.omg.IOP.Encoding ; 28 import org.omg.PortableInterceptor.ORBInitInfo ; 29 import org.omg.PortableInterceptor.ORBInitializer ; 30 31 38 public class TxClientInterceptorInitializer 39 extends LocalObject 40 implements ORBInitializer 41 { 42 43 static final long serialVersionUID = 5904050829195193816L; 44 45 public TxClientInterceptorInitializer() 46 { 47 } 49 50 52 public void pre_init(ORBInitInfo info) 53 { 54 } 56 57 public void post_init(ORBInitInfo info) 58 { 59 try 60 { 61 Encoding encoding = new Encoding (ENCODING_CDR_ENCAPS.value, 63 (byte)1, 64 (byte)0 ); 65 Codec codec = info.codec_factory().create_codec(encoding); 66 67 org.omg.CORBA.Object obj = 69 info.resolve_initial_references("PICurrent"); 70 org.omg.PortableInterceptor.Current piCurrent = 71 org.omg.PortableInterceptor.CurrentHelper.narrow(obj); 72 73 TxClientInterceptor.init(info.allocate_slot_id(), codec, piCurrent); 75 76 TxClientInterceptor interceptor = new TxClientInterceptor(); 78 info.add_client_request_interceptor(interceptor); 79 } 80 catch (Exception e) 81 { 82 throw new RuntimeException ("Unexpected " + e); 83 } 84 } 85 86 } 87 | Popular Tags |