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,TraceExecutionTime
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 Flowm_Ownerthe 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 voidcleanUp()Cleans up data structures, frees up memory.intcompareTo(Object o)Compares this object with the specified object for order.booleanequals(Object o)Returns whether the two objects are the same.voidfinishListening()Gets called when the flow execution ends.static String[]getListeners()Returns a list with classnames of processors.FlowgetOwner()Returns the owning flow.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.voidsetOwner(Flow value)Sets the owning flow.FlowExecutionListenershallowCopy()Returns a shallow copy of itself, i.e., based on the commandline options.FlowExecutionListenershallowCopy(boolean expand)Returns a shallow copy of itself, i.e., based on the commandline options.voidstartListening()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:
setOwnerin interfaceFlowExecutionListener- Parameters:
value- the owner
-
getOwner
public Flow getOwner()
Returns the owning flow.- Specified by:
getOwnerin interfaceFlowExecutionListener- Returns:
- the owner
-
startListening
public void startListening()
Gets called when the flow execution starts.
Default implementation does nothing.- Specified by:
startListeningin interfaceFlowExecutionListener
-
preInput
public void preInput(Actor actor, Token token)
Gets called before the actor receives the token.
Default implementation does nothing.- Specified by:
preInputin 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:
postInputin 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:
preExecutein 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:
postExecutein 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:
preOutputin 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:
postOutputin 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:
cleanUpin 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:
compareToin 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:
shallowCopyin 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:
shallowCopyin 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:
finishListeningin interfaceFlowExecutionListener
-
-