public void execute(final Command command) throws CommandExecutorException, CommandException {
logger.debug("BEGIN execute");
if (command == null) {
throw new CommandExecutorException("command not defined!");
}
logger.debug("executing command: " + command.toString());
if (!command.getCategory().equalsIgnoreCase(getCategory())) {
throw new CommandException("command category mismatch: found \"" + command.getCategory() + "\" required \"" + getCategory() + "\"");
}
if (command.isAsynchronous() && command.getCommandGroupId() != null && "COMPOUND".equals(command.getCommandGroupId())) {
List<String> jobIdList = null;
if (command.containsParameterKey("JOB_ID_LIST")) {
jobIdList = command.getParameterMultivalue("JOB_ID_LIST");
command.deleteParameter("JOB_ID_LIST");
} else {
jobIdList = getJobList(command).getJobIdList();
}
if (command.containsParameterKey("EXECUTION_MODE")) {
if (Command.EXECUTION_MODE_SERIAL.equals(command.getParameterAsString("EXECUTION_MODE"))) {
command.setExecutionMode(Command.ExecutionModeValues.SERIAL);
} else {
command.setExecutionMode(Command.ExecutionModeValues.PARALLEL);
}
}
if (command.containsParameterKey("PRIORITY_LEVEL")) {
command.setPriorityLevel(Integer.parseInt(command.getParameterAsString("PRIORITY_LEVEL")));
}
if (jobIdList != null) {
for (String jobId : jobIdList) {
command.addParameter("JOB_ID", jobId);
command.setCommandGroupId(jobId);
try {
getCommandManager().execute(command);
} catch (CommandManagerException e) {
logger.error(e.getMessage());
throw new CommandExecutorException(e.getMessage());
}
}
}
if (command.getExecutionCompletedTime() == null) {