1 21 package org.jacorb.transaction; 22 23 import org.omg.PortableInterceptor.*; 24 import org.jacorb.orb.*; 25 import org.omg.IOP.*; 26 33 34 public class TransactionInitializer 35 extends org.omg.CORBA.LocalObject 36 implements ORBInitializer 37 { 38 public static int slot_id; 39 40 public TransactionInitializer() 41 { 42 } 43 44 49 public void post_init(ORBInitInfo info) 50 { 51 try 52 { 53 ORB orb = ((org.jacorb.orb.portableInterceptor.ORBInitInfoImpl)info).getORB(); 54 slot_id = info.allocate_slot_id(); 55 56 Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value, 57 (byte) 1, (byte) 0); 58 Codec codec = info.codec_factory().create_codec(encoding); 59 60 TransactionCurrentImpl ts_current = new TransactionCurrentImpl(orb, slot_id); 61 info.register_initial_reference("TransactionCurrent", ts_current); 62 63 info.add_client_request_interceptor( 64 new ClientContextTransferInterceptor(slot_id, codec)); 65 66 info.add_server_request_interceptor( 67 new ServerContextTransferInterceptor(codec, 68 slot_id, 69 ts_current, 70 orb)); 71 72 } 73 catch (Exception e) 74 { 75 } 77 } 78 79 public void pre_init(ORBInitInfo info) { 80 } 81 82 } 84 | Popular Tags |