Package adams.flow.execution
Class MultiListener
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<FlowExecutionListener>,SizeOfHandler,FlowExecutionListener,GraphicalFlowExecutionListener,Serializable,Comparable
public class MultiListener extends AbstractFlowExecutionListener implements GraphicalFlowExecutionListener
A meta-listener that executes all sub-listeners sequentially.
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-listener <adams.flow.execution.FlowExecutionListener> [-listener ...] (property: subListeners) The array of listeners to use. default:
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BasePanelm_ListenerPanelthe listener panel.protected FlowExecutionListener[]m_Listenersthe listeners.-
Fields inherited from class adams.flow.execution.AbstractFlowExecutionListener
m_Owner
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description MultiListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcreateTitle(HashSet<String> titles, String initial)Creates a new tab title, ensures uniqueness.voiddefineOptions()Adds options to the internal list of options.voidfinishListening()Gets called when the flow execution ends.DimensiongetDefaultFrameSize()Returns the default size for the frame.booleangetDisposeOnFinish()Returns whether the frame should get disposed when the flow finishes.StringgetListenerTitle()The title of this listener.FlowExecutionListener[]getSubListeners()Returns the listeners in use.StringglobalInfo()Returns a string describing the object.BasePanelnewListenerPanel()Returns the panel to use.BasePanelnewListenerPanelIfNecessary()Returns a new panel if necessary.voidpostExecute(Actor actor)Gets called after the actor was executed.voidpostInput(Actor actor)Gets called after the actor received the token.voidpostOutput(Actor actor, Token token)Gets called after a token was acquired from the actor.voidpreExecute(Actor actor)Gets called before the actor gets executed.voidpreInput(Actor actor, Token token)Gets called before the actor receives the token.voidpreOutput(Actor actor)Gets called before a token gets obtained from the actor.voidsetSubListeners(FlowExecutionListener[] value)Sets the listeners to use.voidstartListening()Gets called when the flow execution starts.StringsubListenersTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.execution.AbstractFlowExecutionListener
cleanUp, compareTo, equals, getListeners, getOwner, setOwner, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.CleanUpHandler
cleanUp
-
Methods inherited from interface adams.flow.execution.FlowExecutionListener
getOwner, setOwner
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Listeners
protected FlowExecutionListener[] m_Listeners
the listeners.
-
m_ListenerPanel
protected BasePanel m_ListenerPanel
the listener panel.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setSubListeners
public void setSubListeners(FlowExecutionListener[] value)
Sets the listeners to use.- Parameters:
value- the listeners to use
-
getSubListeners
public FlowExecutionListener[] getSubListeners()
Returns the listeners in use.- Returns:
- the listeners
-
subListenersTipText
public String subListenersTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
startListening
public void startListening()
Gets called when the flow execution starts.- Specified by:
startListeningin interfaceFlowExecutionListener- Overrides:
startListeningin classAbstractFlowExecutionListener
-
preInput
public void preInput(Actor actor, Token token)
Gets called before the actor receives the token.- Specified by:
preInputin interfaceFlowExecutionListener- Overrides:
preInputin classAbstractFlowExecutionListener- Parameters:
actor- the actor that will receive the tokentoken- the token that the actor will receive
-
postInput
public void postInput(Actor actor)
Gets called after the actor received the token.- Specified by:
postInputin interfaceFlowExecutionListener- Overrides:
postInputin classAbstractFlowExecutionListener- Parameters:
actor- the actor that received the token
-
preExecute
public void preExecute(Actor actor)
Gets called before the actor gets executed.- Specified by:
preExecutein interfaceFlowExecutionListener- Overrides:
preExecutein classAbstractFlowExecutionListener- Parameters:
actor- the actor that will get executed
-
postExecute
public void postExecute(Actor actor)
Gets called after the actor was executed.- Specified by:
postExecutein interfaceFlowExecutionListener- Overrides:
postExecutein classAbstractFlowExecutionListener- Parameters:
actor- the actor that was executed
-
preOutput
public void preOutput(Actor actor)
Gets called before a token gets obtained from the actor.- Specified by:
preOutputin interfaceFlowExecutionListener- Overrides:
preOutputin classAbstractFlowExecutionListener- Parameters:
actor- the actor the token gets obtained from
-
postOutput
public void postOutput(Actor actor, Token token)
Gets called after a token was acquired from the actor.- Specified by:
postOutputin interfaceFlowExecutionListener- Overrides:
postOutputin classAbstractFlowExecutionListener- Parameters:
actor- the actor that the token was acquired fromtoken- the token that was acquired from the actor
-
getListenerTitle
public String getListenerTitle()
The title of this listener.- Specified by:
getListenerTitlein interfaceGraphicalFlowExecutionListener- Returns:
- the title
-
createTitle
protected String createTitle(HashSet<String> titles, String initial)
Creates a new tab title, ensures uniqueness.- Parameters:
titles- the titles so farinitial- the initial title- Returns:
- the final title
-
newListenerPanelIfNecessary
public BasePanel newListenerPanelIfNecessary()
Returns a new panel if necessary.- Specified by:
newListenerPanelIfNecessaryin interfaceGraphicalFlowExecutionListener- Returns:
- the control panel
-
newListenerPanel
public BasePanel newListenerPanel()
Returns the panel to use.- Specified by:
newListenerPanelin interfaceGraphicalFlowExecutionListener- Returns:
- the panel, null if none available
-
getDefaultFrameSize
public Dimension getDefaultFrameSize()
Returns the default size for the frame.- Specified by:
getDefaultFrameSizein interfaceGraphicalFlowExecutionListener- Returns:
- the frame size
-
getDisposeOnFinish
public boolean getDisposeOnFinish()
Returns whether the frame should get disposed when the flow finishes.
Returns only true if all sub-listeners return true.- Specified by:
getDisposeOnFinishin interfaceGraphicalFlowExecutionListener- Returns:
- true if to dispose when flow finishes
-
finishListening
public void finishListening()
Gets called when the flow execution ends.- Specified by:
finishListeningin interfaceFlowExecutionListener- Overrides:
finishListeningin classAbstractFlowExecutionListener
-
-