1 package test.interceptor.ctx_passing; 2 3 import org.omg.PortableInterceptor.*; 4 import org.omg.IOP.*; 5 6 15 16 public class ClientInitializer 17 extends org.omg.CORBA.LocalObject 18 implements ORBInitializer 19 { 20 public static int slot_id = -1; 21 22 public ClientInitializer() 23 { 24 } 25 26 28 32 public void pre_init(ORBInitInfo info) 33 { 34 } 35 36 40 public void post_init(ORBInitInfo info) 41 { 42 try 43 { 44 slot_id = info.allocate_slot_id(); 45 46 Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value, 47 (byte) 1, (byte) 0); 48 Codec codec = info.codec_factory().create_codec(encoding); 49 50 info.add_client_request_interceptor( new ClientInterceptor( slot_id, codec )); 51 } 52 catch( Exception e ) 53 { 54 e.printStackTrace(); 55 } 56 } 57 } 59 | Popular Tags |