Methods Summary |
---|
public com.sun.appserv.management.config.ClusteredServerConfig | createClusteredServer(java.lang.String serverName, java.lang.String nodeAgentName, int basePort)
final DomainConfig domainConfig = getDomainConfig();
if ( domainConfig.getClusteredServerConfigMap().get( serverName ) != null )
{
domainConfig.removeClusteredServerConfig( serverName );
}
else if ( domainConfig.getStandaloneServerConfigMap().get( serverName ) != null )
{
domainConfig.removeStandaloneServerConfig( serverName );
}
final ClusterConfig clusterConfig =
ClusterConfigTest.ensureDefaultInstance( domainConfig );
if ( domainConfig.getClusteredServerConfigMap().get( serverName ) != null )
{
domainConfig.removeClusteredServerConfig( serverName );
assert domainConfig.getClusteredServerConfigMap().get( serverName ) == null;
}
final ConfigSetup setup = new ConfigSetup( getDomainRoot() );
final Map<String,String> options = new HashMap<String,String>();
setup.setupServerPorts( options, basePort );
final ClusteredServerConfig csc =
domainConfig.createClusteredServerConfig( serverName,
clusterConfig.getName(),
nodeAgentName,
options );
sanityCheck( csc );
return csc;
|
private void | sanityCheck(com.sun.appserv.management.config.ClusteredServerConfig csc)
assert XTypes.CLUSTERED_SERVER_CONFIG.equals( csc.getJ2EEType() );
final String configName = csc.getReferencedConfigName();
final String nodeAgentName = csc.getReferencedNodeAgentName();
final Map<String,DeployedItemRefConfig> deployedItems =
csc.getDeployedItemRefConfigMap();
final Map<String,ResourceRefConfig> resources =
csc.getResourceRefConfigMap();
final String lbWeight = csc.getLBWeight();
csc.setLBWeight( lbWeight );
|
public void | testCreateRemove()
final DomainConfig domainConfig = getDomainConfig();
final NodeAgentConfig nodeAgentConfig = getDASNodeAgentConfig();
if ( nodeAgentConfig == null )
{
warning( "SKIPPING ClusteredServerConfigTest.testCreateRemove: " +
"no DAS Node Agent has been specified; use " +
PropertyKeys.DAS_NODE_AGENT_NAME );
}
else
{
final int NUM = 5;
final String baseName = "ClusteredServerConfigTest";
verifyRefContainers();
final ClusteredServerConfig[] servers = new ClusteredServerConfig[ NUM ];
for( int i = 0; i < NUM; ++i )
{
final int basePort = 11000 + i * 10;
servers[ i ] = createClusteredServer( baseName + "-" + i,
nodeAgentConfig.getName(),
basePort );
printVerbose( "Created ClusteredServerConfig: " + servers[ i ].getName() );
assert XTypes.CLUSTERED_SERVER_CONFIG.equals( servers[ i ].getJ2EEType() );
verifyRefContainers();
}
for( int i = 0; i < NUM; ++i )
{
final String name = servers[ i ].getName();
domainConfig.removeClusteredServerConfig( name );
printVerbose( "Removed ClusteredServerConfig: " + name );
}
}
|
private void | verifyRefContainers()
final Set<String> j2eeTypes =
GSetUtil.newUnmodifiableStringSet(
XTypes.DEPLOYED_ITEM_REF_CONFIG, XTypes.RESOURCE_REF_CONFIG );
final Set<RefConfig> refs = getQueryMgr().queryJ2EETypesSet( j2eeTypes );
for( final RefConfig ref : refs )
{
assert ref.getContainer() != null :
"MBean " + Util.getObjectName( ref ) + " return null from getContainer()";
}
|