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 TxServerInterceptorInitializer 39 extends LocalObject 40 implements ORBInitializer 41 { 42 43 static final long serialVersionUID = -547674655727747575L; 44 45 public TxServerInterceptorInitializer() 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 TxServerInterceptor.init(info.allocate_slot_id(), codec, piCurrent); 76 77 TxServerInterceptor interceptor = new TxServerInterceptor(); 79 info.add_server_request_interceptor(interceptor); 80 } 81 catch (Exception e) 82 { 83 throw new RuntimeException ("Unexpected " + e); 84 } 85 } 86 87 } 88 | Popular Tags |