shocks.client
Class Result

java.lang.Object
  extended byshocks.client.Result
All Implemented Interfaces:
DataSource

public class Result
extends java.lang.Object
implements DataSource

DataSource containing information about the execution of a target Action.

result
(n.) 3.b. The effect, consequence, issue, or outcome of some action, process, design, etc;
(v.) [f. re- RE- + saltare to leap.] 2.c. To recoil; to rebound or spring back. Obs.
-- Oxford English Dictionary

Result objects are a type of DataSource used by the container to carry information about an Action back up the workflow sequence to the WorkflowController.

This information must include a "result" string corresponding to one of the "name" attributes from the shocks-workflow.xml file (see below), but may also include any of the following:

  • instructions about whether or not the target Action was successful in its execution
  • Errors
  • Exceptions
  • Custom, application-specific information about the Action

    The ActionSupport implementation, or "target action" ideally doesn't make assumptions about which object, if any, will make use of the contents of its Result object. It worries about its own end and lets the WorkflowController and applicable FilterSupport implementations handle the Result.

    On its way back up the workflow sequence, the Result object can be passed into system-level actions (FilterSupport implementations), which can use it to perform common operations like logging, i18n, Error and Exception handling, system-level testing, custom alerts, or handle information from the target Action which are application specific but system-wide.


    Constructor Summary
    Result(java.lang.String result)
              The String parameter for the constructor is the only required data for a valid Result.
     
    Method Summary
     java.lang.Object getAttribute(java.lang.String key)
              Uses the incoming key to find and return an object of nonspecific type.
     void setAttribute(java.lang.String key, java.lang.Object value)
              Stores the incoming value object and creates a mapping to it with the String key.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    Result

    public Result(java.lang.String result)
    The String parameter for the constructor is the only required data for a valid Result. This string must correspond to one of the "name" attributes of a "result" element associated with the currently executing action from the shocks-workflow.xml descriptor file.

    Parameters:
    result -
    Method Detail

    setAttribute

    public void setAttribute(java.lang.String key,
                             java.lang.Object value)
    Description copied from interface: DataSource
    Stores the incoming value object and creates a mapping to it with the String key.

    Specified by:
    setAttribute in interface DataSource
    Parameters:
    key -
    value -

    getAttribute

    public java.lang.Object getAttribute(java.lang.String key)
    Description copied from interface: DataSource
    Uses the incoming key to find and return an object of nonspecific type.

    Specified by:
    getAttribute in interface DataSource
    Parameters:
    key -
    Returns:
    Object