|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UsecaseInvoker
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); } }
Field Summary | |
---|---|
static int |
EXECUTION_CONDITIONS_FAILED
The execution condition check failed. |
static int |
EXECUTION_FAILED
The execution itself failed. |
static int |
POSTCONDITIONS_FAILED
The postcondition check failed. |
static int |
PRECONDITIONS_FAILED
The precondition check failed. |
static java.lang.String |
ROLE
The Avalon role. |
static int |
SUCCESS
The invocation was successful. |
Method Summary | |
---|---|
java.util.List |
getErrorMessages()
Returns the error messages from the previous operation. |
java.util.List |
getInfoMessages()
Returns the info messages from the previous operation. |
int |
getResult()
|
java.lang.String |
getTargetUrl()
|
void |
invoke(java.lang.String webappUrl,
java.lang.String usecaseName,
java.util.Map parameters)
Invokes a usecase. |
void |
setTestSession(org.apache.lenya.cms.repository.Session session)
|
Field Detail |
---|
static final java.lang.String ROLE
static final int SUCCESS
static final int PRECONDITIONS_FAILED
static final int EXECUTION_CONDITIONS_FAILED
static final int EXECUTION_FAILED
static final int POSTCONDITIONS_FAILED
Method Detail |
---|
void invoke(java.lang.String webappUrl, java.lang.String usecaseName, java.util.Map parameters) throws UsecaseException
webappUrl
- The URL to invoke the usecase on.usecaseName
- The name of the usecase.parameters
- The parameters.
UsecaseException
- if an error occurs.int getResult()
java.util.List getErrorMessages()
UsecaseMessage
objects.java.util.List getInfoMessages()
UsecaseMessage
objects.java.lang.String getTargetUrl()
void setTestSession(org.apache.lenya.cms.repository.Session session)
session
- The test session to use.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |