use of org.activityinfo.legacy.shared.command.result.CommandResult in project activityinfo by bedatadriven.
the class DispatcherStub method findResult.
private CommandResult findResult(Command command) {
CommandResult result = results.get(command);
if (result == null) {
result = resultByClass.get(command.getClass());
if (result == null) {
throw new AssertionError("Unexpected command: " + command.toString());
}
}
log.add(command);
return result;
}
use of org.activityinfo.legacy.shared.command.result.CommandResult in project activityinfo by bedatadriven.
the class CommandServlet method handleCommand.
protected CommandResult handleCommand(Command command) throws CommandException {
RemoteExecutionContext context = null;
try {
context = new RemoteExecutionContext(injector);
CommandResult result = context.startExecute(command);
if (result instanceof CommandException) {
LOGGER.log(Level.SEVERE, "Exception executing " + command.getClass().getSimpleName(), (CommandException) result);
}
return result;
} catch (CommandException e) {
throw e;
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Exception executing " + command.getClass().getSimpleName(), e);
throw new CommandException(command, context, e);
}
}
Aggregations