This service allows to invoke a usecase in a convenient way. A typical usage
scenario is the composition of usecases - you can invoke one or multiple
"child" usecases from another usecase.
Example:
UsecaseInvoker invoker = null;
try {
invoker = (UsecaseInvoker) this.manager.lookup(UsecaseInvoker.ROLE);
Map params = new HashMap();
params.put(..., ...);
invoker.invoke(getSourceUrl(), childUsecaseName, params);
if (invoker.getResult() != UsecaseInvoker.SUCCESS) {
List messages = invoker.getErrorMessages();
for (Iterator i = messages.iterator(); i.hasNext();) {
UsecaseMessage message = (UsecaseMessage) i.next();
addErrorMessage(message.getMessage(), message.getParameters());
}
}
} finally {
if (invoker != null) {
this.manager.release(invoker);
}
}
version: $Id: UsecaseInvoker.java 507914 2007-02-15 12:15:30Z andreas $ |