Package adams.flow.execution
Class AbstractFlowExecutionListener
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.execution.AbstractFlowExecutionListener
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<FlowExecutionListener>
,SizeOfHandler
,FlowExecutionListener
,Serializable
,Comparable
- Direct Known Subclasses:
AbstractGraphicalFlowExecutionListener
,ExecutionLog
,MultiListener
,NullListener
,RemoteFlowListener
public abstract class AbstractFlowExecutionListener extends AbstractOptionHandler implements Comparable, FlowExecutionListener, ShallowCopySupporter<FlowExecutionListener>
Ancestor for execution listeners.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Flow
m_Owner
the 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 AbstractFlowExecutionListener()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Cleans up data structures, frees up memory.int
compareTo(Object o)
Compares this object with the specified object for order.boolean
equals(Object o)
Returns whether the two objects are the same.void
finishListening()
Gets called when the flow execution ends.static String[]
getListeners()
Returns a list with classnames of processors.Flow
getOwner()
Returns the owning flow.void
postExecute(Actor actor)
Gets called after the actor was executed.void
postInput(Actor actor)
Gets called after the actor received the token.void
postOutput(Actor actor, Token token)
Gets called after a token was acquired from the actor.void
preExecute(Actor actor)
Gets called before the actor gets executed.void
preInput(Actor actor, Token token)
Gets called before the actor receives the token.void
preOutput(Actor actor)
Gets called before a token gets obtained from the actor.void
setOwner(Flow value)
Sets the owning flow.FlowExecutionListener
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.FlowExecutionListener
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.void
startListening()
Gets called when the flow execution starts.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Owner
protected Flow m_Owner
the owner.
-
-
Method Detail
-
setOwner
public void setOwner(Flow value)
Sets the owning flow.- Specified by:
setOwner
in interfaceFlowExecutionListener
- Parameters:
value
- the owner
-
getOwner
public Flow getOwner()
Returns the owning flow.- Specified by:
getOwner
in interfaceFlowExecutionListener
- Returns:
- the owner
-
startListening
public void startListening()
Gets called when the flow execution starts.
Default implementation does nothing.- Specified by:
startListening
in interfaceFlowExecutionListener
-
preInput
public void preInput(Actor actor, Token token)
Gets called before the actor receives the token.
Default implementation does nothing.- Specified by:
preInput
in interfaceFlowExecutionListener
- 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.
Default implementation does nothing.- Specified by:
postInput
in interfaceFlowExecutionListener
- Parameters:
actor
- the actor that received the token
-
preExecute
public void preExecute(Actor actor)
Gets called before the actor gets executed.
Default implementation does nothing.- Specified by:
preExecute
in interfaceFlowExecutionListener
- Parameters:
actor
- the actor that will get executed
-
postExecute
public void postExecute(Actor actor)
Gets called after the actor was executed.
Default implementation does nothing.- Specified by:
postExecute
in interfaceFlowExecutionListener
- Parameters:
actor
- the actor that was executed
-
preOutput
public void preOutput(Actor actor)
Gets called before a token gets obtained from the actor.
Default implementation does nothing.- Specified by:
preOutput
in interfaceFlowExecutionListener
- 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.
Default implementation does nothing.- Specified by:
postOutput
in interfaceFlowExecutionListener
- Parameters:
actor
- the actor that the token was acquired fromtoken
- the token that was acquired from the actor
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.
Default implementation cleans up options.- Specified by:
cleanUp
in interfaceCleanUpHandler
-
compareTo
public int compareTo(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Only compares the commandlines of the two objects.- Specified by:
compareTo
in interfaceComparable
- Parameters:
o
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException
- if the specified object's type prevents it from being compared to this object.
-
equals
public boolean equals(Object o)
Returns whether the two objects are the same.
Only compares the commandlines of the two objects.
-
shallowCopy
public FlowExecutionListener shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<FlowExecutionListener>
- Returns:
- the shallow copy
-
shallowCopy
public FlowExecutionListener shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<FlowExecutionListener>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
getListeners
public static String[] getListeners()
Returns a list with classnames of processors.- Returns:
- the processor classnames
-
finishListening
public void finishListening()
Gets called when the flow execution ends.
Default implementation only unsets the owner.- Specified by:
finishListening
in interfaceFlowExecutionListener
-
-