com.opensymphony.xwork
Interface ActionProxy

All Known Implementing Classes:
DefaultActionProxy, MockActionProxy

public interface ActionProxy

ActionProxy is an extra layer between XWork and the action so that different proxies are possible.

An example of this would be a remote proxy, where the layer between XWork and the action might be RMI or SOAP.

Author:
Jason Carreira Created Jun 9, 2003 11:27:55 AM

Method Summary
 String execute()
          Execute this ActionProxy.
 Object getAction()
           
 String getActionName()
           
 ActionConfig getConfig()
           
 boolean getExecuteResult()
           
 ActionInvocation getInvocation()
           
 String getMethod()
          Returns the method to execute, or null if no method has been specified (meaning "execute" will be invoked)
 String getNamespace()
           
 void setExecuteResult(boolean executeResult)
          Sets whether this ActionProxy should also execute the Result after executing the Action
 void setMethod(String method)
          Sets the method to execute for the action invocation.
 

Method Detail

getAction

public Object getAction()
Returns:
the Action instance for this Proxy

getActionName

public String getActionName()
Returns:
the alias name this ActionProxy is mapped to

getConfig

public ActionConfig getConfig()
Returns:
the ActionConfig this ActionProxy is built from

setExecuteResult

public void setExecuteResult(boolean executeResult)
Sets whether this ActionProxy should also execute the Result after executing the Action

Parameters:
executeResult -

getExecuteResult

public boolean getExecuteResult()
Returns:
the status of whether the ActionProxy is set to execute the Result after the Action is executed

getInvocation

public ActionInvocation getInvocation()
Returns:
the ActionInvocation associated with this ActionProxy

getNamespace

public String getNamespace()
Returns:
the namespace the ActionConfig for this ActionProxy is mapped to

execute

public String execute()
               throws Exception
Execute this ActionProxy. This will set the ActionContext from the ActionInvocation into the ActionContext ThreadLocal before invoking the ActionInvocation, then set the old ActionContext back into the ThreadLocal.

Returns:
the result code returned from executing the ActionInvocation
Throws:
Exception
See Also:
ActionInvocation

setMethod

public void setMethod(String method)
Sets the method to execute for the action invocation. If no method is specified, the method provided by in the action's configuration will be used.

Parameters:
method - the string name of the method to invoke

getMethod

public String getMethod()
Returns the method to execute, or null if no method has been specified (meaning "execute" will be invoked)


XWork Project Page