package org.fulworx.core.invoker;
import java.util.Map;
/**
* Invoke an action and return the result. Other invokers may be wired in via the default spring context,
* allowing the developer to change this behavior in arbitrary ways (for instance, supplying resources
* from other systems, etc.)
* <p/>
* Another use would be to supply additional context parameters for actions.
*/
public interface ActionInvoker
{
/**
* Map the actionName and parameters to an underlying action. For XWork, this invokes the action and
* supplies the extra context parameters.
*
* @param extraContext any contextual parameters that might be relevant
* @param actionName of action to be invoked
* @param parameters for the action
* @return the result of the action
* @throws CodedException wrapped exceptions for a nice way of reporting externally
*/
ActionResult invoke(Map extraContext, String actionName, String methodName, Map<String, Object> parameters) throws
CodedException;
/**
* Map the actionName and parameters to an underlying action. For XWork, this invokes the action and
* supplies the extra context parameters.
*
* @param nameSpace of the action
* @param extraContext any contextual parameters that might be relevant
* @param actionName of action to be invoked
* @param parameters for the action
* @return the result of the action
* @throws CodedException wrapped exceptions for a nice way of reporting externally
*/
ActionResult invoke(String nameSpace, Map extraContext, String actionName, String methodName, Map<String, Object> parameters) throws
CodedException;
}
|