Methods Summary |
---|
private com.sun.appserv.management.config.ConfigConfig | create(java.lang.String name)
final ConfigSetup setup = new ConfigSetup( getDomainRoot() );
setup.removeConfig( name );
final ConfigConfig config = setup.createConfig( name );
assert( name.equals( config.getName() ) );
// see that it responds to a request
final Map<String,Object> attrs = Util.getExtra( config ).getAllAttributes();
//printVerbose( "Attributes for config " + config.getName() + ":" );
//printVerbose( MapUtil.toString( attrs, NEWLINE ) );
return config;
|
public static com.sun.appserv.management.config.ConfigConfig | ensureDefaultInstance(com.sun.appserv.management.DomainRoot domainRoot)
ConfigConfig config = null;
final DomainConfig domainConfig = domainRoot.getDomainConfig();
final Map<String,ConfigConfig> existing = domainConfig.getConfigConfigMap();
if ( supportsMultipleServers( domainRoot ) )
{
config = existing.get( getDefaultInstanceName( domainRoot ) );
if ( config == null )
{
final ConfigSetup setup = new ConfigSetup( domainRoot );
config = setup.createConfig( getDefaultInstanceName( domainRoot ) );
}
}
else
{
config = existing.get( PE_CONFIG_NAME );
assert( config != null ) : "No config named " + StringUtil.quote( PE_CONFIG_NAME );
}
return config;
|
public static java.lang.String | getDefaultInstanceName(com.sun.appserv.management.DomainRoot domainRoot)
String name = null;
if ( domainRoot.getSystemInfo().supportsFeature( SystemInfo.MULTIPLE_SERVERS_FEATURE ) )
{
name = getDefaultInstanceName( "ConfigConfigTest" );
}
else
{
name = PE_CONFIG_NAME;
}
return name;
|
public void | testCreateRemove()
if ( ! checkNotOffline( "testCreateRemove" ) )
{
return;
}
final String NAME = "ConfigConfigTest.testCreateRemove";
final Map<String,ConfigConfig> before = getDomainConfig().getConfigConfigMap();
final int NUM = 2;
final ConfigConfig[] configs = new ConfigConfig[ NUM ];
for( int i = 0; i < NUM; ++i )
{
configs[ i ] = create( NAME + i );
}
final ConfigSetup setup = new ConfigSetup( getDomainRoot() );
for( final ConfigConfig config : configs )
{
setup.removeConfig( config.getName() );
// verify that the config is gone
try
{
Util.getExtra( config ).getAllAttributes();
fail( "Config " + config.getName() + " should no longer exist" );
}
catch( Exception e )
{
// good, we expected to be here
}
}
final Map<String,ConfigConfig> after = getDomainConfig().getConfigConfigMap();
assert( before.keySet().equals( after.keySet() ) );
|