final String serverName,
final String clusterName,
final String nodeAgentName,
final Map<String,String> optional)
{
final ClusterConfig clusterConfig =
getDomainConfig().getClusterConfigMap().get( clusterName );
if ( clusterConfig == null )
{
throw new IllegalArgumentException( "" + clusterName );
}
final String configName = clusterConfig.getReferencedConfigName();
debug( "creating server:\n" + (optional == null ? "null" : MapUtil.toString( optional )) );
final ObjectName serverObjectName =
super.create( serverName, nodeAgentName, configName, optional );
// now create a reference.
debug( "created server: " + serverName + " in cluster " + clusterName +
"with node agent " + nodeAgentName );
final Map<String,String> options = new HashMap<String,String>();
options.put( ServerRefConfigCR.ENABLED_KEY, "true" );
options.put( ServerRefConfigCR.LB_ENABLED_KEY, "" + getLBEnabled(clusterConfig) );
debug( "creating reference" );
final ServerRefConfig refConfig =
clusterConfig.createServerRefConfig( serverName, options );
debug( "created reference" );
// Now wait until internal code mutates the STANDALONE_SERVER_CONFIG into
// a CLUSTERED_SERVER_CONFIG
final String props = Util.makeRequiredProps( XTypes.CLUSTERED_SERVER_CONFIG, serverName );