1 22 package org.jboss.iiop.codebase; 23 24 import org.omg.CORBA.LocalObject ; 25 import org.omg.IOP.Codec ; 26 import org.omg.IOP.Encoding ; 27 import org.omg.IOP.ENCODING_CDR_ENCAPS ; 28 import org.omg.PortableInterceptor.ORBInitializer ; 29 import org.omg.PortableInterceptor.ORBInitInfo ; 30 31 39 public class CodebaseInterceptorInitializer 40 extends LocalObject 41 implements ORBInitializer 42 { 43 44 public CodebaseInterceptorInitializer() 45 { 46 } 48 49 51 public void pre_init(ORBInitInfo info) 52 { 53 } 55 56 public void post_init(ORBInitInfo info) 57 { 58 try { 59 Encoding encoding = new Encoding (ENCODING_CDR_ENCAPS.value, 61 (byte)1, 62 (byte)0 ); 63 Codec codec = info.codec_factory().create_codec(encoding); 64 info.add_ior_interceptor(new CodebaseInterceptor(codec)); 65 info.register_policy_factory(CodebasePolicy.TYPE, 66 new CodebasePolicyFactory()); 67 } 68 catch (Exception e) { 69 throw new RuntimeException ("Unexpected " + e); 70 } 71 } 72 73 } 74 | Popular Tags |