Methods Summary |
---|
protected void | checkConfiguration()
if (action == null) {
final String msg = lsm.getString("ActionCommandMustBeSpecified");
throw new BuildException(msg, getLocation());
}
if (!ACTION_MAP.containsKey(action)) {
final String msg = lsm.getString("InvalidActionCommand", new Object[] {action});
throw new BuildException(msg, getLocation());
}
super.checkConfiguration();
|
protected void | checkConfiguration(Server aServer)
if (aServer.getInstance() == null) {
final String msg = lsm.getString("InstanceAttributeRequired");
throw new BuildException(msg, getLocation());
}
InstanceServer instanceSvr = (InstanceServer) aServer;
/*
if (instanceSvr.isLocal() || (instanceSvr.getDomain() != null)) {
if (instanceSvr.getHost() != null) {
final String msg = lsm.getString("HostAttributeIgnored");
log(msg, Project.MSG_WARN);
}
if (instanceSvr.getPort() != 0) {
final String msg = lsm.getString("PortAttributeIgnored");
log(msg, Project.MSG_WARN);
}
if ((instanceSvr.getUser() != null) && (!instanceSvr.getUser().equals("admin"))) {
final String msg = lsm.getString("UserAttributeIgnored");
log(msg, Project.MSG_WARN);
}
if (instanceSvr.hasPassword()) {
final String msg = lsm.getString("PasswordAttributeIgnored");
log(msg, Project.MSG_WARN);
}
} else {
if (!instanceSvr.hasPassword()) {
final String msg = lsm.getString("PasswordAttributeNotSpecified");
throw new BuildException(msg, getLocation());
}
}
if ((instanceSvr.getDomain() != null) && !instanceSvr.isLocal()) {
final String msg = lsm.getString("DomainAttributeIgnored");
log(msg, Project.MSG_WARN);
}
*/
if (!instanceSvr.hasPassword()) {
final String msg = lsm.getString("PasswordAttributeNotSpecified");
throw new BuildException(msg, getLocation());
}
if (action.equals(ACTION_CREATE)) {
if (instanceSvr.getNodeagent() == null) {
final String msg = lsm.getString("AttributeMustBeSpecified", new Object[] {"nodeagent"});
throw new BuildException(msg, getLocation());
}
}
|
protected void | execute(Server aServer)
InstanceServer instanceSvr = (InstanceServer) aServer;
if ( instanceSvr.getConfig() != null &&
instanceSvr.getCluster() != null ) {
final String msg = lsm.getString("MutuallyExclusivelyAttribute",
new Object[] {"config", "cluster"});
throw new BuildException(msg, getLocation());
}
StringBuffer cmd = new StringBuffer((String) ACTION_MAP.get(action));
cmd.append(instanceSvr.getCommandParameters(false));
if (action.equals(ACTION_CREATE)) {
//cmd.append(" --instanceport " + instanceSvr.getInstanceport());
cmd.append(" --nodeagent " + instanceSvr.getNodeagent());
if (instanceSvr.getConfig() != null)
cmd.append(" --config " + instanceSvr.getConfig());
if (instanceSvr.getCluster() != null)
cmd.append(" --cluster " + instanceSvr.getCluster());
if (instanceSvr.getProperty() != null)
cmd.append(" --systemproperties " + instanceSvr.getProperty());
} else if (action.equals(ACTION_START)) {
//cmd.append(" --debug=" + instanceSvr.isDebug());
}
/*
if (instanceSvr.isLocal()) {
if (instanceSvr.getDomain() != null) {
cmd.append(" --domain ").append(instanceSvr.getDomain());
}
cmd.append(" --local=true");
} else {
cmd.append(instanceSvr.getCommandParameters(false));
}
*/
cmd.append(' ").append(instanceSvr.getInstance());
execAdminCommand(cmd.toString());
/* String cmdString = (String) ACTION_MAP.get(action);
cmdString += aServer.getCommandParameters(false);
if (action.equals(ACTION_CREATE)) {
cmdString += " --instanceport " + aServer.getInstanceport();
}
if (aServer.getInstance() != null) {
cmdString += " " + aServer.getInstance();
}
execAdminCommand(cmdString);
*/
|
protected Server | getNewServer()
return new InstanceServer(server);
|
public void | setAction(java.lang.String action)Sets the action for the instance command.
this.action = action;
|
public void | setCluster(java.lang.String cluster)Sets the cluster to be used by a new application server instance.
((InstanceServer)server).setCluster(cluster); // Delegates to server object
|
public void | setConfig(java.lang.String config)Sets the config to be used by a new application server instance.
((InstanceServer)server).setConfig(config); // Delegates to server object
|
public void | setDebug(boolean debug)Set if the instance should be started in debug mode. Defaults to
false .
final String msg = lsm.getString("AttributeNotSupported",
new Object[] {"debug"});
log(msg, Project.MSG_WARN);
//((InstanceServer)server).setDebug(debug); // Delegates to server object
|
public void | setDomain(java.lang.String domain)Sets the domain for the administrative command -- some commands allow the
domain to be set for "local" commands instead of username, password, host
and password.
final String msg = lsm.getString("AttributeNotSupported",
new Object[] {"domain"});
log(msg, Project.MSG_WARN);
//((InstanceServer)server).setDomain(domain); // Delegates to server object
|
public void | setInstanceport(int instanceport)Sets the port number to be used by a new application server instance.
final String msg = lsm.getString("AttributeNotSupported",
new Object[] {"instanceport"});
log(msg, Project.MSG_WARN);
//((InstanceServer)server).setInstanceport(instanceport);
|
public void | setLocal(boolean local)Set if the instance should be started without an admin server
running.
final String msg = lsm.getString("AttributeNotSupported",
new Object[] {"local"});
log(msg, Project.MSG_WARN);
//((InstanceServer)server).setLocal(local); // Delegates to server object
|
public void | setNodeagent(java.lang.String nodeagent)Sets the nodeagent to be used by a new application server instance.
((InstanceServer)server).setNodeagent(nodeagent); // Delegates to server object
|
public void | setProperty(java.lang.String property)Sets the property to be used by a new application server instance.
((InstanceServer)server).setProperty(property); // Delegates to server object
|