1 23 package com.sun.enterprise.management.config; 24 25 import java.util.Map ; 26 27 import javax.management.ObjectName ; 28 29 import com.sun.appserv.management.util.jmx.MBeanServerConnectionConnectionSource; 30 import com.sun.appserv.management.util.misc.ExceptionUtil; 31 32 import com.sun.appserv.management.base.AMX; 33 import com.sun.appserv.management.base.Container; 34 import com.sun.appserv.management.base.XTypes; 35 36 import com.sun.appserv.management.config.AMXConfig; 37 import com.sun.appserv.management.config.SecurityServiceConfig; 38 import com.sun.appserv.management.config.JACCProviderConfig; 39 40 41 import com.sun.enterprise.management.AMXTestBase; 42 import com.sun.enterprise.management.Capabilities; 43 44 46 public final class JACCProviderConfigTest extends ConfigMgrTestBase 47 { 48 static final String PROVIDER = "com.sun.enterprise.security.provider.PolicyWrapper"; 49 static final String PROVIDER_FACTORY = "com.sun.enterprise.security.provider.PolicyConfigurationFactoryImpl"; 50 static final Map <String ,String > RESERVED = null; 51 52 public 53 JACCProviderConfigTest() 54 { 55 if ( checkNotOffline( "ensureDefaultInstance" ) ) 56 { 57 ensureDefaultInstance( getConfigConfig().getSecurityServiceConfig() ); 58 } 59 } 60 public static String 61 getDefaultInstanceName() 62 { 63 return getDefaultInstanceName( "JACCProviderConfig" ); 64 } 65 66 public static JACCProviderConfig 67 ensureDefaultInstance( final SecurityServiceConfig ss ) 68 { 69 JACCProviderConfig result = ss.getJACCProviderConfigMap().get( getDefaultInstanceName() ); 70 71 if ( result == null ) 72 { 73 result = createInstance( ss, getDefaultInstanceName(), PROVIDER, PROVIDER_FACTORY ); 74 } 75 76 return result; 77 } 78 79 public static JACCProviderConfig 80 createInstance( 81 final SecurityServiceConfig ss, 82 final String name, 83 final String policyProvider, 84 final String policyConfigurationFactoryProvider ) 85 { 86 return ss.createJACCProviderConfig( name, 87 policyProvider, policyConfigurationFactoryProvider, null ); 88 } 89 90 91 protected Container 92 getProgenyContainer() 93 { 94 return getConfigConfig().getSecurityServiceConfig(); 95 } 96 97 protected String 98 getProgenyJ2EEType() 99 { 100 return XTypes.JACC_PROVIDER_CONFIG; 101 } 102 103 104 protected void 105 removeProgeny( final String name ) 106 { 107 getConfigConfig().getSecurityServiceConfig().removeJACCProviderConfig( name ); 108 } 109 110 protected final AMXConfig 111 createProgeny(final String name, final Map <String ,String > options ) 112 { 113 return getConfigConfig().getSecurityServiceConfig().createJACCProviderConfig(name, PROVIDER, PROVIDER_FACTORY, options); 114 } 115 } 116 117 118 | Popular Tags |