org.springframework.webflow.execution.factory
Class ConditionalFlowExecutionListenerLoader

java.lang.Object
  extended by org.springframework.webflow.execution.factory.ConditionalFlowExecutionListenerLoader
All Implemented Interfaces:
FlowExecutionListenerLoader

public class ConditionalFlowExecutionListenerLoader
extends java.lang.Object
implements FlowExecutionListenerLoader

A flow execution listener loader that stores listeners in a list-backed data structure and allows for configuration of which listeners should apply to which flow definitions. For trivial listener loading, see StaticFlowExecutionListenerLoader.

Author:
Keith Donald
See Also:
StaticFlowExecutionListenerLoader

Field Summary
protected  org.apache.commons.logging.Log logger
          Logger, usable by subclasses.
 
Constructor Summary
ConditionalFlowExecutionListenerLoader()
           
 
Method Summary
 void addListener(FlowExecutionListener listener)
          Add a listener that will listen to executions for all flows.
 void addListener(FlowExecutionListener listener, FlowExecutionListenerCriteria criteria)
          Add a listener that will listen to executions to flows matching the specified criteria.
 void addListeners(FlowExecutionListener[] listeners, FlowExecutionListenerCriteria criteria)
          Adds a collection of listeners that share a matching criteria.
 boolean containsListener(FlowExecutionListener listener)
          Is the given listener contained by this Flow execution manager?
protected  FlowExecutionListenerCriteria getCriteria(java.lang.String value)
          Decode given string value into one of the well known criteria types.
 FlowExecutionListener[] getListeners(FlowDefinition flowDefinition)
          Returns the array of flow execution listeners for specified flow.
 void removeAllListeners()
          Remove all listeners loadable by this loader.
 void removeListener(FlowExecutionListener listener)
          Remove the flow execution listener from the listener list.
 void removeListenerCriteria(FlowExecutionListener listener, FlowExecutionListenerCriteria criteria)
          Remove the criteria for the specified listener.
 void setListeners(java.util.Map listenersWithCriteria)
          Set the list of flow execution listeners with corresponding criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Logger, usable by subclasses.

Constructor Detail

ConditionalFlowExecutionListenerLoader

public ConditionalFlowExecutionListenerLoader()
Method Detail

addListener

public void addListener(FlowExecutionListener listener)
Add a listener that will listen to executions for all flows.

Parameters:
listener - the listener to add

addListeners

public void addListeners(FlowExecutionListener[] listeners,
                         FlowExecutionListenerCriteria criteria)
Adds a collection of listeners that share a matching criteria.

Parameters:
listeners - the listeners
criteria - the criteria where these listeners apply

addListener

public void addListener(FlowExecutionListener listener,
                        FlowExecutionListenerCriteria criteria)
Add a listener that will listen to executions to flows matching the specified criteria.

Parameters:
listener - the listener
criteria - the listener criteria

setListeners

public void setListeners(java.util.Map listenersWithCriteria)
Set the list of flow execution listeners with corresponding criteria. Allows for bean style configuration. The given map should have FlowExecutionListener objects as keys and Strings ("*", "flowId", "flowId1,flowId2") or FlowExecutionListenerCriteria objects as values. This will clear any listeners registered with this object using the addListener methods.

Parameters:
listenersWithCriteria - the map of listeners and their corresponding criteria

containsListener

public boolean containsListener(FlowExecutionListener listener)
Is the given listener contained by this Flow execution manager?

Parameters:
listener - the listener
Returns:
true if yes, false otherwise

removeListener

public void removeListener(FlowExecutionListener listener)
Remove the flow execution listener from the listener list.

Parameters:
listener - the listener

removeAllListeners

public void removeAllListeners()
Remove all listeners loadable by this loader.


removeListenerCriteria

public void removeListenerCriteria(FlowExecutionListener listener,
                                   FlowExecutionListenerCriteria criteria)
Remove the criteria for the specified listener.

Parameters:
listener - the listener
criteria - the criteria

getListeners

public FlowExecutionListener[] getListeners(FlowDefinition flowDefinition)
Returns the array of flow execution listeners for specified flow.

Specified by:
getListeners in interface FlowExecutionListenerLoader
Parameters:
flowDefinition - the flow definition associated with the execution to be listened to
Returns:
the flow execution listeners that apply

getCriteria

protected FlowExecutionListenerCriteria getCriteria(java.lang.String value)
Decode given string value into one of the well known criteria types.

See Also:
FlowExecutionListenerCriteriaFactory


Copyright © 2009 Spring Framework. All Rights Reserved.