moduleID = (String) args[2];
CommandType newState = (CommandType) args[3];
SunTarget domain = (SunTarget) args[4];
StringManager localStrings = StringManager.getManager(getClass());
ModuleType moduleType;
try {
moduleType = DeploymentClientUtils.getModuleType(
dasConnection.getExistingMBeanServerConnection(), moduleID);
} catch (Throwable ioex) {
finalDeploymentStatus.setStageException(ioex);
setupForAbnormalExit(localStrings.getString("enterprise.deployment.client.unrecognized_module_type", moduleID ,ioex.getMessage()),
domain);
return;
}
boolean state = false;
String action = "Disable";
if (CommandType.START.equals(newState)) {
state = true;
action = "Enable";
}
// the target module ids in which the operation was successful
ArrayList resultTargetModuleIDs = new ArrayList();
for(int i=0; i<targets.length; i++) {
DeploymentStatus stat = new DeploymentStatus();
stat.setStageDescription(
localStrings.getString("enterprise.deployment.client.state_change_desc", action, moduleID));
try {
/*
*If the module type supports state changes, change the state.
*Otherwise prepare a warning status with a "no-op" message.
*/
String messageKey;
int deplStatus;
if (! unchangeableStateModuleTypes.contains(moduleType)) {
messageKey = "enterprise.deployment.client.state_change_success";
deplStatus = DeploymentStatus.SUCCESS;
DeploymentClientUtils.changeStateOfModule(dasConnection.getExistingMBeanServerConnection(), moduleID,
((moduleType == null) ? null : moduleType.toString()), targets[i], state);
} else {
messageKey = "enterprise.deployment.client.state_change_noop";
deplStatus = DeploymentStatus.SUCCESS;
}
stat.setStageStatus(deplStatus);