= getNodeAgentConfigBean(getConfigContext());
if (nodeController != null) {
Properties props = null;
ElementProperty elementProperty = null;
Cluster cluster = null;
// need a default, can't have %%%DOMAIN_NAME%%% go into
// running server
String domainName="DomainPropertyNotFound";
// set default to "" because this string will actual be placed
// in the startserv's java command for starting the instance
// via the ProcessLauncher. This is the easiest way to have the
// com.sun.aas.clusterName set to null for a standalone Instance
String clusterArg = "";
for (int ii = 0; ii < servers.length; ii++) {
// check to see if the server belongs to this
// node agent (repository)
if (instanceConfig.getRepositoryName().equals(
servers[ii].getNodeAgentRef())) {
// check if instance already exists or
// needs to be created.
if (instanceExists(servers[ii].getName())) {
getLogger().log(Level.INFO,
"nodeagent.instance.exists", servers[ii].getName());
} else {
// instance does not exist so create it
getLogger().log(Level.INFO,
"nodeagent.create.instance", servers[ii].getName());
instanceConfig.setInstanceName(servers[ii].getName());
// set properties for token replacing startserv scripts
props = new Properties();
// add proper domain
elementProperty = domain.getElementPropertyByName(
DOMAIN_XML_DOMAIN_NAME_PROPERTY_NAME);
if (elementProperty != null)
domainName=elementProperty.getValue();
getLogger().log(Level.INFO,
"domain for instance - " + domainName);
props.setProperty(EEScriptsTokens.DOMAIN_NAME,
domainName);
if (ServerHelper.isServerClustered(
getConfigContext(), servers[ii].getName())) {
try {
// see if part of cluster
cluster = ClusterHelper.getClusterForInstance(
getConfigContext(), servers[ii].getName());
if (cluster != null)
clusterArg = "-D" + CLUSTER_NAME + "=\""
+ cluster.getName() + "\"";
} catch (ConfigException ce) {
// show at finest, because the server may
// not be part of cluster
getLogger().log(Level.FINEST,
"Server isn't part of cluster", ce);