1 package org.jacorb.security.sas; 2 3 22 23 import org.apache.avalon.framework.configuration.ConfigurationException; 24 import org.apache.avalon.framework.logger.Logger; 25 import org.jacorb.orb.standardInterceptors.SASComponentInterceptor; 26 import org.jacorb.sasPolicy.ATLAS_POLICY_TYPE; 27 import org.jacorb.sasPolicy.SAS_POLICY_TYPE; 28 import org.omg.IOP.CodecFactoryPackage.UnknownEncoding ; 29 import org.omg.PortableInterceptor.ORBInitInfo ; 30 import org.omg.PortableInterceptor.ORBInitializer ; 31 import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName ; 32 33 39 40 public class SASInitializer 41 extends org.omg.CORBA.LocalObject 42 implements ORBInitializer 43 { 44 private Logger logger = null; 45 public static final int SecurityAttributeService = 15; 46 public static int sasPrincipalNamePIC = (-1); 47 48 51 public void post_init( ORBInitInfo info ) 52 { 53 org.jacorb.orb.ORB orb = 54 ((org.jacorb.orb.portableInterceptor.ORBInitInfoImpl)info).getORB (); 55 logger = 56 orb.getConfiguration().getNamedLogger("jacorb.security.SAS"); 57 58 try 60 { 61 sasPrincipalNamePIC = info.allocate_slot_id(); 62 info.add_server_request_interceptor(new SASTargetInterceptor(info)); 63 } 64 catch (ConfigurationException ce) 65 { 66 if (logger.isErrorEnabled()) 67 logger.error("ConfigurationException", ce); 68 } 69 catch (DuplicateName duplicateName) 70 { 71 if (logger.isErrorEnabled()) 72 logger.error("TSS DuplicateName", duplicateName); 73 } 74 catch (UnknownEncoding unknownEncoding) 75 { 76 if (logger.isErrorEnabled()) 77 logger.error("TSS UnknownEncoding", unknownEncoding); 78 } 79 80 try 82 { 83 info.add_client_request_interceptor(new SASClientInterceptor(info)); 84 } 85 catch (ConfigurationException ce) 86 { 87 if (logger.isErrorEnabled()) 88 logger.error("ConfigurationException", ce); 89 } 90 catch (DuplicateName duplicateName) 91 { 92 if (logger.isErrorEnabled()) 93 logger.error("CSS DuplicateName", duplicateName); 94 } 95 catch (UnknownEncoding unknownEncoding) 96 { 97 if (logger.isErrorEnabled()) 98 logger.error("CSS UnknownEncoding", unknownEncoding); 99 } 100 101 try 103 { 104 info.add_ior_interceptor(new SASComponentInterceptor(info)); 105 } 106 catch (DuplicateName duplicateName) 107 { 108 if (logger.isErrorEnabled()) 109 logger.error("IOR DuplicateName", duplicateName); 110 } 111 112 info.register_policy_factory( SAS_POLICY_TYPE.value, new SASPolicyFactory() ); 114 info.register_policy_factory( ATLAS_POLICY_TYPE.value, new ATLASPolicyFactory() ); 115 } 116 117 public void pre_init(ORBInitInfo info) 118 { 119 } 120 } | Popular Tags |