@SuppressWarnings("rawtypes")
@Override
protected void process(final String target, final Request baseRequest, final HttpServletRequest request, final HttpServletResponse response) {
final CommandKey commandKey = targetUriCommandKeyMap.get(target);
final WebRequestCommand command = (WebRequestCommand) commandService.getCommand(commandKey);
final WebCommandContext<?, ?> commandContext;
try {
commandContext = createWebCommandContext(command, baseRequest, request, response);
} catch (JAXBException | IOException e) {
log.error(String.format("%s : Failed to unmarshal request message", target), e);
handleUnmarshallingRequestMessageError(baseRequest, response, e);
return;
}
try {
command.execute(commandContext);
} catch (final Exception e) {
log.error(String.format("%s : Failed to execute command : %s", target, commandKey), e);
handleCommandExecutionError(baseRequest, response, e);
}
}