}
// check access rights for the command
if (securityContext.isCommandAuthorized(commandName)) {
Command command = null;
try {
command = applicationContext.getBean(commandName, Command.class);
} catch (BeansException be) {
log.error("could not create command bean for {}", new Object[] { commandName }, be);
}
if (null != command) {
response = command.getEmptyCommandResponse();
response.setId(id);
try {
command.execute(request, response);
} catch (Throwable throwable) { //NOPMD
log.error("Error executing command", throwable);
response.getErrors().add(throwable);
}
} else {