1 23 24 package com.sun.enterprise.iiop; 25 26 import org.omg.CosNaming.*; 27 import org.omg.IOP.Codec ; 28 import org.omg.IOP.CodecFactory ; 29 import org.omg.IOP.CodecFactoryHelper ; 30 import org.omg.IOP.Encoding ; 31 import org.omg.IOP.ENCODING_CDR_ENCAPS ; 32 import org.omg.PortableInterceptor.ORBInitializer ; 33 import org.omg.PortableInterceptor.ORBInitInfo ; 34 import org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName ; 35 import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName ; 36 37 import java.util.logging.*; 38 import com.sun.logging.*; 39 40 44 public class IORAddrAnyInitializer extends org.omg.CORBA.LocalObject 45 implements ORBInitializer { 46 47 private static Logger _logger=null; 48 static { 49 _logger=LogDomains.getLogger(LogDomains.CORBA_LOGGER); 50 } 51 52 public static final String baseMsg = IORAddrAnyInitializer.class.getName(); 53 54 55 public IORAddrAnyInitializer() { 56 } 57 58 68 public void pre_init(org.omg.PortableInterceptor.ORBInitInfo info) { 69 } 70 71 89 public void post_init(org.omg.PortableInterceptor.ORBInitInfo info) { 90 Codec codec = null; 91 CodecFactory cf = info.codec_factory(); 92 93 byte major_version = 1; 94 byte minor_version = 2; 95 Encoding encoding = new Encoding (ENCODING_CDR_ENCAPS.value, 96 major_version, minor_version); 97 try { 98 codec = cf.create_codec(encoding); 99 } catch (org.omg.IOP.CodecFactoryPackage.UnknownEncoding e) { 100 _logger.log(Level.WARNING,"UnknownEncoding from " + baseMsg,e); 101 } 102 try { 103 info.add_ior_interceptor(new IORAddrAnyInterceptor(codec)); 104 } catch (DuplicateName ex) { 105 _logger.log(Level.WARNING,"DuplicateName from " + baseMsg,ex); 106 } 107 } 108 109 } 110 | Popular Tags |