org.apache.commons.workflow.util
Class ContextSupport

java.lang.Object
  extended by org.apache.commons.workflow.util.ContextSupport

public class ContextSupport
extends Object

ContextSupport is a convenience class for managing the firing of ContextEvents to registered ContextListeners.

Version:
$Revision: 155475 $ $Date: 2005-02-26 13:31:11 +0000 (Sat, 26 Feb 2005) $
Author:
Craig R. McClanahan

Field Summary
protected  Context context
          The Context for whom we will fire events.
protected  ContextListener[] listeners
          The set of registered ContextListener event listeners.
 
Constructor Summary
ContextSupport(Context context)
          Construct a new ContextSupport object associated with the specified Context.
 
Method Summary
 void addContextListener(ContextListener listener)
          Add a listener that is notified each time beans are added, replaced, or removed in this context.
 void fireAfterActivity(Step step)
          Fire a afterActivity event to all registered listeners.
 void fireAfterActivity(Step step, StepException exception)
          Fire a afterActivity event to all registered listeners.
 void fireAfterStep(Step step)
          Fire a afterStep event to all registered listeners.
 void fireAfterStep(Step step, StepException exception)
          Fire a afterStep event to all registered listeners.
 void fireBeforeActivity(Step step)
          Fire a beforeActivity event to all registered listeners.
 void fireBeforeStep(Step step)
          Fire a beforeStep event to all registered listeners.
 void removeContextListener(ContextListener listener)
          Remove a listener that is notified each time beans are added, replaced, or removed in this context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected ContextListener[] listeners
The set of registered ContextListener event listeners.


context

protected Context context
The Context for whom we will fire events.

Constructor Detail

ContextSupport

public ContextSupport(Context context)
Construct a new ContextSupport object associated with the specified Context.

Parameters:
context - Context for whom we will fire events
Method Detail

addContextListener

public void addContextListener(ContextListener listener)
Add a listener that is notified each time beans are added, replaced, or removed in this context.

Parameters:
listener - The ContextListener to be added

removeContextListener

public void removeContextListener(ContextListener listener)
Remove a listener that is notified each time beans are added, replaced, or removed in this context.

Parameters:
listener - The ContextListener to be removed

fireAfterActivity

public void fireAfterActivity(Step step)
Fire a afterActivity event to all registered listeners.

Parameters:
step - Step that was executed last

fireAfterActivity

public void fireAfterActivity(Step step,
                              StepException exception)
Fire a afterActivity event to all registered listeners.

Parameters:
step - Step that was executed last
exception - StepException thrown by the last Step

fireAfterStep

public void fireAfterStep(Step step)
Fire a afterStep event to all registered listeners.

Parameters:
step - Step that was executed

fireAfterStep

public void fireAfterStep(Step step,
                          StepException exception)
Fire a afterStep event to all registered listeners.

Parameters:
step - Step that was executed
exception - StepException thrown by the executed step

fireBeforeActivity

public void fireBeforeActivity(Step step)
Fire a beforeActivity event to all registered listeners.

Parameters:
step - Step that will be executed first

fireBeforeStep

public void fireBeforeStep(Step step)
Fire a beforeStep event to all registered listeners.

Parameters:
step - Step that is about to be executed


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.