1 28 29 30 package org.objectweb.corba.logservice; 31 32 import org.objectweb.corba.runtime.*; 33 34 38 public class LogORBInitializerImpl 39 extends org.omg.CORBA.LocalObject 40 implements org.omg.PortableInterceptor.ORBInitializer 41 { 42 public 43 LogORBInitializerImpl() 44 { 45 } 46 47 51 final public void 52 pre_init(org.omg.PortableInterceptor.ORBInitInfo info) 53 { 54 } 55 56 final public void 57 post_init(org.omg.PortableInterceptor.ORBInitInfo info) 58 { 59 org.omg.IOP.Encoding enc = new org.omg.IOP.Encoding (); 61 enc.format = org.omg.IOP.ENCODING_CDR_ENCAPS.value; 62 enc.major_version = (byte)1; 63 enc.minor_version = (byte)2; 64 65 org.omg.IOP.CodecFactory fact = null; 66 org.omg.IOP.Codec codec = null; 67 68 fact = info.codec_factory(); 69 70 try { 71 codec = fact.create_codec(enc); 72 } catch (org.omg.IOP.CodecFactoryPackage.UnknownEncoding ex) { 73 return ; 74 } 75 76 int slot = info.allocate_slot_id(); 78 79 LogCurrentImpl logcurrent = new LogCurrentImpl(info, slot, info.orb_id()); 81 try { 82 info.register_initial_reference(LOG_CURRENT_ID.value, logcurrent); 83 } catch (org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName ex) { 84 throw new java.lang.Error (ex.getMessage()); 85 } 86 87 try { 89 info.add_client_request_interceptor(new LogCRIImpl(info, codec, slot)); 90 info.add_server_request_interceptor(new LogSRIImpl(codec, slot)); 91 } catch (org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName ex) { 92 throw new java.lang.Error (ex.getMessage()); 93 } 94 } 95 } 96 | Popular Tags |