Package adams.flow.core
Class AbstractExternalActor
-
- All Implemented Interfaces:
AdditionalInformationHandler,CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,ShallowCopySupporter<Actor>,SizeOfHandler,Stoppable,StoppableWithFeedback,VariablesInspectionHandler,VariableChangeListener,FlowStructureModifier,Actor,ErrorHandler,ExternalActorFileHandler,ExternalActorHandler,Serializable,Comparable
- Direct Known Subclasses:
ExternalSink,ExternalSource,ExternalStandalone,ExternalTransformer
public abstract class AbstractExternalActor extends AbstractBaseExternalActor implements ExternalActorHandler
Ancestor of actors that load another actor from disk and execute it.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_ActorFileChangedwhether the external actor file has changed.protected Booleanm_ActorFileIsVariableindicates whether a variable is attached to the external file.protected Stringm_ActorFileVariablethe variable attached to the external file.protected Actorm_ExternalActorthe external actor itself.protected FileChangeMonitorm_Monitorthe file monitor.protected booleanm_OnTheFlywhether the flow gets built on the fly and might not be present at the start.-
Fields inherited from class adams.flow.core.AbstractBaseExternalActor
m_ActorFile
-
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.flow.core.Actor
FILE_EXTENSION, FILE_EXTENSION_GZ
-
-
Constructor Summary
Constructors Constructor Description AbstractExternalActor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()Cleans up after the execution has finished.voidcleanUpExternalActor()Cleans up the external actor.voiddefineOptions()Adds options to the internal list of options.protected StringdoExecute()Executes the flow item.protected voidforceVariables(Variables value)Updates the Variables instance in use.ActorgetExternalActor()Returns the external actor.FileChangeMonitorgetMonitor()Returns the file change monitor for the actor file.booleangetOnTheFly()Returns whether the flow file gets built on the fly and might not be present at start up time.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.StringmonitorTipText()Returns the tip text for this property.StringonTheFlyTipText()Returns the tip text for this property.protected StringpreExecuteExternalActorHook()Gets called in the doExceute() method, after an optional setUpExternalActor() call (in case a variable is used for the actor file), but before the external actor's execute() method is called.voidsetMonitor(FileChangeMonitor value)Sets the file change monitor for the actor file.voidsetOnTheFly(boolean value)Sets whether the flow file gets built on the fly and might not be present at start up time.voidsetParent(Actor value)Sets the parent of this actor, e.g., the group it belongs to.StringsetUp()Initializes the item for flow execution.StringsetUpExternalActor()Sets up the external actor.voidstopExecution()Stops the execution.voidvariableChanged(VariableChangeEvent e)Gets triggered when a variable changed (added, modified, removed).voidwrapUp()Cleans up after the execution has finished.-
Methods inherited from class adams.flow.core.AbstractBaseExternalActor
actorFileTipText, getActorFile, getActualActorFile, isModifyingStructure, setActorFile
-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, backupState, canInspectOptions, canPerformSetUpCheck, compareTo, configureLogger, destroy, equals, execute, finalUpdateVariables, findVariables, findVariables, forCommandLine, forName, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, initialize, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, postExecute, preExecute, pruneBackup, pruneBackup, reset, restoreState, setAnnotations, setErrorHandler, setName, setSilent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.flow.core.Actor
compareTo, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setErrorHandler, setName, setSilent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, sizeOf, stopExecution, toCommandLine
-
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
-
Methods inherited from interface adams.flow.core.ExternalActorFileHandler
getActorFile, setActorFile
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager
-
Methods inherited from interface adams.core.VariablesInspectionHandler
canInspectOptions
-
-
-
-
Field Detail
-
m_Monitor
protected FileChangeMonitor m_Monitor
the file monitor.
-
m_OnTheFly
protected boolean m_OnTheFly
whether the flow gets built on the fly and might not be present at the start.
-
m_ExternalActor
protected Actor m_ExternalActor
the external actor itself.
-
m_ActorFileIsVariable
protected Boolean m_ActorFileIsVariable
indicates whether a variable is attached to the external file.
-
m_ActorFileVariable
protected String m_ActorFileVariable
the variable attached to the external file.
-
m_ActorFileChanged
protected boolean m_ActorFileChanged
whether the external actor file has changed.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractBaseExternalActor
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceActor- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractBaseExternalActor- Returns:
- null if no info available, otherwise short string
-
setMonitor
public void setMonitor(FileChangeMonitor value)
Sets the file change monitor for the actor file.- Parameters:
value- the monitor
-
getMonitor
public FileChangeMonitor getMonitor()
Returns the file change monitor for the actor file.- Returns:
- the monitor
-
monitorTipText
public String monitorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOnTheFly
public void setOnTheFly(boolean value)
Sets whether the flow file gets built on the fly and might not be present at start up time.- Parameters:
value- if true then the flow does not have to be present at start up time
-
getOnTheFly
public boolean getOnTheFly()
Returns whether the flow file gets built on the fly and might not be present at start up time.- Returns:
- true if the flow is not necessarily present at start up time
-
onTheFlyTipText
public String onTheFlyTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setParent
public void setParent(Actor value)
Sets the parent of this actor, e.g., the group it belongs to.- Specified by:
setParentin interfaceActor- Overrides:
setParentin classAbstractActor- Parameters:
value- the new parent
-
variableChanged
public void variableChanged(VariableChangeEvent e)
Gets triggered when a variable changed (added, modified, removed).- Specified by:
variableChangedin interfaceActor- Specified by:
variableChangedin interfaceVariableChangeListener- Overrides:
variableChangedin classAbstractActor- Parameters:
e- the event
-
getExternalActor
public Actor getExternalActor()
Returns the external actor.- Specified by:
getExternalActorin interfaceExternalActorHandler- Returns:
- the actor, can be null if not initialized yet or failed to initialize
-
cleanUpExternalActor
public void cleanUpExternalActor()
Cleans up the external actor.- Specified by:
cleanUpExternalActorin interfaceExternalActorHandler
-
setUpExternalActor
public String setUpExternalActor()
Sets up the external actor.- Specified by:
setUpExternalActorin interfaceExternalActorHandler- Returns:
- null if everything is fine, otherwise error message
-
forceVariables
protected void forceVariables(Variables value)
Updates the Variables instance in use.
Use with caution!- Overrides:
forceVariablesin classAbstractActor- Parameters:
value- the instance to use
-
setUp
public String setUp()
Initializes the item for flow execution.- Specified by:
setUpin interfaceActor- Overrides:
setUpin classAbstractActor- Returns:
- null if everything is fine, otherwise error message
- See Also:
AbstractActor.reset()
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceActor- Specified by:
stopExecutionin interfaceStoppable- Overrides:
stopExecutionin classAbstractActor
-
preExecuteExternalActorHook
protected String preExecuteExternalActorHook()
Gets called in the doExceute() method, after an optional setUpExternalActor() call (in case a variable is used for the actor file), but before the external actor's execute() method is called.
Default implementation does nothing.- Returns:
- null if everything ok, otherwise error message
- See Also:
doExecute(),setUpExternalActor()
-
doExecute
protected String doExecute()
Executes the flow item.- Specified by:
doExecutein classAbstractActor- Returns:
- null if everything is fine, otherwise error message
-
wrapUp
public void wrapUp()
Cleans up after the execution has finished. Graphical output is left untouched.- Specified by:
wrapUpin interfaceActor- Overrides:
wrapUpin classAbstractActor
-
cleanUp
public void cleanUp()
Cleans up after the execution has finished.- Specified by:
cleanUpin interfaceActor- Specified by:
cleanUpin interfaceCleanUpHandler- Overrides:
cleanUpin classAbstractActor
-
-