Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.opensymphony.xwork2
Class DefaultActionProxy

    java.lang.Object
      com.opensymphony.xwork2.DefaultActionProxy

All Implemented Interfaces:
  ActionProxy, Serializable

Direct Known Subclasses:
  DWRValidator.ValidatorActionProxy, StrutsActionProxy

    public class DefaultActionProxy

extends Object
implements ActionProxy, Serializable

The Default ActionProxy implementation

Since:
  2005-8-6
Version:
  $Date: 2006-12-13 07:17:15 +0100 (Mi, 13 Dez 2006) $ $Id: DefaultActionProxy.java 1269 2006-12-13 06:17:15Z mrdon $
Author:
  Rainer Hermanns, Revised by Henry Hu, tmjee
See Also:
  Serialized Form

Field Summary
`protected ActionEventListener` | `actionEventListener`
`protected String` | `actionName`
`protected boolean` | `cleanupContext`
`protected ActionConfig` | `config`
`protected Configuration` | `configuration`
`protected boolean` | `executeResult`
`protected Map` | `extraContext`
`protected ActionInvocation` | `invocation`
`private static Log` | `LOG`
`protected String` | `method`
`protected String` | `namespace`
`protected ObjectFactory` | `objectFactory`
`private static long` | `serialVersionUID`
`protected UnknownHandler` | `unknownHandler`

Constructor Summary
`protected` | `DefaultActionProxy(String namespace, String actionName, Map extraContext, boolean executeResult, boolean cleanupContext)` This constructor is private so the builder methods (create*) should be used to create an DefaultActionProxy.

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` | `prepare()` Called after all dependencies are set
`private void` | `resolveMethod()`
`void` | `setActionEventListener(ActionEventListener listener)`
`void` | `setConfiguration(Configuration config)`
`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.
`void` | `setObjectFactory(ObjectFactory factory)`
`void` | `setUnknownHandler(UnknownHandler handler)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### serialVersionUID

    private static final long serialVersionUID

See Also:
  Constant Field Values

### LOG

    private static final Log LOG

### configuration

    protected Configuration configuration

### config

    protected ActionConfig config

### invocation

    protected ActionInvocation invocation

### unknownHandler

    protected UnknownHandler unknownHandler

### extraContext

    protected Map extraContext

### actionName

    protected String actionName

### namespace

    protected String namespace

### method

    protected String method

### executeResult

    protected boolean executeResult

### cleanupContext

    protected boolean cleanupContext

### objectFactory

    protected ObjectFactory objectFactory

### actionEventListener

    protected ActionEventListener actionEventListener

Constructor Detail

### DefaultActionProxy

    protected DefaultActionProxy(String namespace,
                                 String actionName,
                                 Map extraContext,
                                 boolean executeResult,
                                 boolean cleanupContext)
                          throws Exception

  This constructor is private so the builder methods (create*) should be used to create an DefaultActionProxy.

  The reason for the builder methods is so that you can use a subclass to create your own DefaultActionProxy instance (like a RMIActionProxy).

  Throws:
    `Exception`

Method Detail

### setObjectFactory

    public void setObjectFactory(ObjectFactory factory)

### setConfiguration

    public void setConfiguration(Configuration config)

### setUnknownHandler

    public void setUnknownHandler(UnknownHandler handler)

### setActionEventListener

    public void setActionEventListener(ActionEventListener listener)

### getAction

    public Object getAction()

  Specified by:
    `getAction` in interface `ActionProxy`
  Returns:
    the Action instance for this Proxy

### getActionName

    public String getActionName()

  Specified by:
    `getActionName` in interface `ActionProxy`
  Returns:
    the alias name this ActionProxy is mapped to

### getConfig

    public ActionConfig getConfig()

  Specified by:
    `getConfig` in interface `ActionProxy`
  Returns:
    the ActionConfig this ActionProxy is built from

### setExecuteResult

    public void setExecuteResult(boolean executeResult)

  Description copied from interface: `ActionProxy`
  Sets whether this ActionProxy should also execute the Result after executing the Action

  Specified by:
    `setExecuteResult` in interface `ActionProxy`

### getExecuteResult

    public boolean getExecuteResult()

  Specified by:
    `getExecuteResult` in interface `ActionProxy`
  Returns:
    the status of whether the ActionProxy is set to execute the Result after the Action is executed

### getInvocation

    public ActionInvocation getInvocation()

  Specified by:
    `getInvocation` in interface `ActionProxy`
  Returns:
    the ActionInvocation associated with this ActionProxy

### getNamespace

    public String getNamespace()

  Specified by:
    `getNamespace` in interface `ActionProxy`
  Returns:
    the namespace the ActionConfig for this ActionProxy is mapped to

### execute

    public String execute()
                   throws Exception

  Description copied from interface: `ActionProxy`
  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.

  Specified by:
    `execute` in interface `ActionProxy`
  Returns:
    the result code returned from executing the ActionInvocation
  Throws:
    `Exception`
  See Also:
    `ActionInvocation`

### getMethod

    public String getMethod()

  Description copied from interface: `ActionProxy`
  Returns the method to execute, or null if no method has been specified (meaning "execute" will be invoked)

  Specified by:
    `getMethod` in interface `ActionProxy`

### setMethod

    public void setMethod(String method)

  Description copied from interface: `ActionProxy`
  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.

  Specified by:
    `setMethod` in interface `ActionProxy`
  Parameters:
    `method` - the string name of the method to invoke

### resolveMethod

    private void resolveMethod()

### prepare

    public void prepare()
                 throws Exception

  Description copied from interface: `ActionProxy`
  Called after all dependencies are set

  Specified by:
    `prepare` in interface `ActionProxy`
  Throws:
    `Exception`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.