if (!authorizer.authorizeUsecase(tab.getUsecase(), this.roles, pub)) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Usecase not authorized");
}
messages = new UsecaseMessage[1];
messages[0] = new UsecaseMessage("Access denied");
}
}
if (usecaseResolver.isRegistered(this.webappUrl, tab.getUsecase())) {
Usecase usecase = null;
try {
usecase = usecaseResolver.resolve(this.webappUrl, tab.getUsecase());
usecase.setSourceURL(this.webappUrl);
usecase.setName(tab.getUsecase());
String[] keys = tab.getParameterNames();
for (int i = 0; i < keys.length; i++) {
usecase.setParameter(keys[i], tab.getParameter(keys[i]));
}
usecase.checkPreconditions();
if (usecase.hasErrors()) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Usecase preconditions not complied");
}
List msgs = usecase.getErrorMessages();
messages = (UsecaseMessage[]) msgs.toArray(new UsecaseMessage[msgs.size()]);
} else {
messages = new UsecaseMessage[0];
}
} finally {
if (usecase != null) {
usecaseResolver.release(usecase);
}
}
} else {
messages = new UsecaseMessage[1];
messages[0] = new UsecaseMessage("Usecase [" + tab.getUsecase()
+ "] is not registered!", null);
}
} catch (final Exception e) {
throw new RuntimeException(e);
} finally {