printLine(e1.getLocalizedMessage());
return;
}
final String cmdName = parsedCmd.getOperationName();
CommandHandler handler = cmdRegistry.getCommandHandler(cmdName.toLowerCase());
if (handler != null) {
if (isBatchMode() && handler.isBatchMode()) {
if (!(handler instanceof OperationCommand)) {
printLine("The command is not allowed in a batch.");
} else {
try {
ModelNode request = ((OperationCommand) handler).buildRequest(this);
BatchedCommand batchedCmd = new DefaultBatchedCommand(line, request);
Batch batch = getBatchManager().getActiveBatch();
batch.add(batchedCmd);
printLine("#" + batch.size() + " " + batchedCmd.getCommand());
} catch (CommandFormatException e) {
printLine("Failed to add to batch: " + e.getLocalizedMessage());
}
}
} else {
try {
handler.handle(this);
} catch (CommandFormatException e) {
printLine(e.getLocalizedMessage());
}
}