com.jbbres.lib.actions.elements
Class ActionExecutionEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.jbbres.lib.actions.elements.ActionExecutionEvent
All Implemented Interfaces:
java.io.Serializable

public class ActionExecutionEvent
extends java.util.EventObject

A semantic event which indicates that an event related to the action execution occured.

This event is generated by an action (via its ActionService) during one of the stage of its execution (such as at the beginning or the end).
The event is passed to every ActionExecutionListener object that registered to receive such events using the service addExecutionListener(ActionExecutionListener) method.

The object that implements the ActionExecutionListener interface gets this ActionExecutionEvent when the event occurs.

Since:
1.0.0
Version:
1.0.0
Author:
Jean-Baptiste Bres
See Also:
ActionService.addExecutionListener(ActionExecutionListener), ActionExecutionListener, Serialized Form

Field Summary
static int ACTION_FAILED
          The action has failed during its execution.
static int ACTION_IN_PROGRESS
          The action is currently executing.
static int ACTION_SUCCEED
          The action has been processed successfully and came to its end.
 
Constructor Summary
ActionExecutionEvent(ActionService source)
          Instantiates a new event.
ActionExecutionEvent(ActionService source, int status)
          Instantiates a new event.
ActionExecutionEvent(ActionService source, int status, java.lang.Object input, Parameters parameters, java.lang.Object result)
          Instantiates a new event.
ActionExecutionEvent(ActionService source, int status, java.lang.Object input, Parameters parameters, java.lang.Object result, java.lang.Throwable exception)
          Instantiates a new event.
ActionExecutionEvent(ActionService source, java.lang.Object input, Parameters parameters)
          Instantiates a new event.
 
Method Summary
 Action getAction(Workflow withinWorkflow)
          Returns the Action that has raised the event.
 ActionService getActionService()
          Returns the ActionService that has raised the event.
 java.lang.Throwable getException()
          Returns the exception that has cause the action to stop, if any.
 Parameters getExecutionParameters()
          Returns the Parameters object that has been given for the action execution.
 java.lang.Object getInputObject()
          Returns the object that has been given as an input for the action execution.
 java.lang.Object getOutputObject()
          Returns the object that has been generated as an output for the action execution.
 int getStatus()
          Returns the action status.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACTION_SUCCEED

public static final int ACTION_SUCCEED
The action has been processed successfully and came to its end.

See Also:
Constant Field Values

ACTION_IN_PROGRESS

public static final int ACTION_IN_PROGRESS
The action is currently executing.

See Also:
Constant Field Values

ACTION_FAILED

public static final int ACTION_FAILED
The action has failed during its execution.

See Also:
Constant Field Values
Constructor Detail

ActionExecutionEvent

public ActionExecutionEvent(ActionService source)
Instantiates a new event.

Parameters:
source - - the ActionService source of the event
See Also:
ActionExecutionEvent(ActionService, int, Object, Parameters, Object, Throwable)

ActionExecutionEvent

public ActionExecutionEvent(ActionService source,
                            int status)
Instantiates a new event.

Parameters:
source - - the ActionService source of the event
status - - the status of the event
See Also:
ActionExecutionEvent(ActionService, int, Object, Parameters, Object, Throwable)

ActionExecutionEvent

public ActionExecutionEvent(ActionService source,
                            java.lang.Object input,
                            Parameters parameters)
Instantiates a new event.

Parameters:
source - - the ActionService source of the event
input - - the input object of the action's execution
parameters - - the parameters of the action's execution
See Also:
ActionExecutionEvent(ActionService, int, Object, Parameters, Object, Throwable)

ActionExecutionEvent

public ActionExecutionEvent(ActionService source,
                            int status,
                            java.lang.Object input,
                            Parameters parameters,
                            java.lang.Object result)
Instantiates a new event.

Parameters:
source - - the ActionService source of the event
status - - the status of the event
input - - the input object of the action's execution
parameters - - the parameters of the action's execution
result - - the output object of the action's execution
See Also:
ActionExecutionEvent(ActionService, int, Object, Parameters, Object, Throwable)

ActionExecutionEvent

public ActionExecutionEvent(ActionService source,
                            int status,
                            java.lang.Object input,
                            Parameters parameters,
                            java.lang.Object result,
                            java.lang.Throwable exception)
Instantiates a new event.

Parameters:
source - - the ActionService source of the event
status - - the status of the event
input - - the input object of the action's execution
parameters - - the parameters of the action's execution
result - - the output object of the action's execution
exception - - the exception raised during the action
Method Detail

getActionService

public ActionService getActionService()
Returns the ActionService that has raised the event.

Returns:
the action service that has raised the event.

getAction

public Action getAction(Workflow withinWorkflow)
Returns the Action that has raised the event.

Parameters:
withinWorkflow - - The workflow containing the action. By conception, the source of this event is an ActionService, not an Action. The ActionService object does not reference the Action it is associated to. To iddentify the action, this method checks all the action within the given workflow and compare their services to the source of this event.
Returns:
the Action that has raised the event.

getStatus

public int getStatus()
Returns the action status.

Returns:
the action status

getInputObject

public java.lang.Object getInputObject()
Returns the object that has been given as an input for the action execution.

If no object has been given as an input, or if the action does not accept input object, this function return null.

Returns:
the object that has been given as an input for the action execution

getExecutionParameters

public Parameters getExecutionParameters()
Returns the Parameters object that has been given for the action execution.
If no parameters have been given as an input, this function return null.

Returns:
the Parameters object that has been given for the action execution

getOutputObject

public java.lang.Object getOutputObject()
Returns the object that has been generated as an output for the action execution.
If no object has been generated as an output, if the execution is not finished or if the action does not generate output object, this function return null.

Returns:
the object that has been generated as an output for the action execution

getException

public java.lang.Throwable getException()
Returns the exception that has cause the action to stop, if any.
If the action succeed during its execution, this method returns null.

Returns:
the exception that has cause the action to stop.


To file bugs or suggest feature enhancements, visit the app.jbbres.com Bug Reporter website.

Additional documentation available online at http://app.jbbres.com/actions/developers.

Copyright � 2009-2011 app.jbbres.com. All Rights Reserved.