Package adams.flow.core
Class AbstractActor
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<Actor>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,VariablesInspectionHandler
,VariableChangeListener
,Actor
,ErrorHandler
,Serializable
,Comparable
- Direct Known Subclasses:
AbstractBaseExternalActor
,AbstractCallableActor
,AbstractControlActor
,AbstractCopyCallableActor
,AbstractDisplay
,AbstractPropertyUpdater
,AbstractScriptedActor
,AbstractSink
,AbstractSource
,AbstractStandalone
,AbstractTemplate
,AbstractTransformer
,CallableActorScreenshot
,ClipboardActorContainer
,DesktopScreenshot
,ExternalFlow
,Stop
,UpdateCallableDisplay
public abstract class AbstractActor extends AbstractOptionHandler implements Actor
Abstract base class for actors.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseAnnotation
m_Annotations
annotations for the actor.protected Hashtable<String,Object>
m_BackupState
for backing up the state of an actor.protected HashSet<String>
m_DetectedObjectVariables
the variable names (referencing callable actors or storage) that are used within this actor.protected HashSet<String>
m_DetectedVariables
the variable names that are used within this actor.protected ErrorHandler
m_ErrorHandler
the error handler to use.protected boolean
m_Executed
whether the actor was executed at least once after setup.protected boolean
m_Executing
whether the actor is currently being executed.protected FlowExecutionListeningSupporter
m_ExecutionListeningSupporter
the flow execution handler.protected String
m_FullName
the full name of the actor.protected String
m_LoggingPrefix
the logging prefix.protected String
m_Name
the name of the actor.protected Actor
m_Parent
the parent actor this actor is part of, e.g., a sequence.protected ScopeHandler
m_ScopeHandler
the scope handler.protected Actor
m_Self
the actor itself.protected boolean
m_Silent
whether to suppress output in the console.protected boolean
m_Skip
whether to skip the transformation and just forward the token.protected boolean
m_StopFlowOnError
whether to stop the flow in case of an error.protected String
m_StopMessage
the message that was used when stopping the execution.protected boolean
m_Stopped
whether the execution was stopped.protected StorageHandler
m_StorageHandler
the storage handler.protected HashSet<String>
m_VariablesUpdated
whether the actor needs re-setting up because of modified variables.-
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 AbstractActor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
annotationsTipText()
Returns the tip text for this property.protected Hashtable<String,Object>
backupState()
Backs up the current state of the actor before update the variables.boolean
canInspectOptions(Class cls)
Checks whether the class' options can be inspected.protected boolean
canPerformSetUpCheck(boolean fromSetUp, String property)
Returns whether a check can be performed currently.void
cleanUp()
Cleans up after the execution has finished.int
compareTo(Object o)
Compares this object with the specified object for order.protected void
configureLogger()
Initializes the logger.void
defineOptions()
Adds options to the internal list of options.void
destroy()
Frees up memory in a "destructive" non-reversible way.protected abstract String
doExecute()
Executes the flow item.boolean
equals(Object o)
Returns whether the two objects are the same.String
execute()
Executes the flow item.protected void
finalUpdateVariables()
Gets called when the actor needs to re-evaluate variables before wrapping up.HashSet<String>
findVariables()
Recursively finds all the variables used in the actor's setup.protected HashSet<String>
findVariables(Actor actor)
Recursively finds all the variables used in the specified actor's setup.protected void
forceVariables(Variables value)
Updates the Variables instance in use.static Actor
forCommandLine(String cmdline)
Instantiates the item from the given commandline (i.e., classname and optional options).static Actor
forName(String classname, String[] options)
Instantiates the item with the given options.static Actor
forName(String classname, String[] options, boolean quiet)
Instantiates the item with the given options.String
getAdditionalInformation()
Returns the additional information.BaseAnnotation
getAnnotations()
Returns the current annotations.String
getDefaultName()
Returns the default name of the actor.HashSet<String>
getDetectedVariables()
Returns the variables this actor is responsible for.ErrorHandler
getErrorHandler()
Returns the current error handler for handling errors in the flow.static String[]
getFlowActors()
Returns a list with classnames of items.FlowExecutionListeningSupporter
getFlowExecutionListeningSupporter()
Returns the flow execution handler in use.String
getFullName()
Returns the full name of the actor, i.e., the concatenated names of all parents.String
getName()
Returns the name of the actor.Actor
getNextSibling()
If the actor is part of a group, this method returns the actor following it in that group.Actor
getParent()
Returns the parent of this actor, e.g., the group.Component
getParentComponent()
Returns the current parent component for interactive actors.Actor
getPreviousSibling()
If the actor is part of a group, this method returns the actor preceding it in that group.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.Actor
getRoot()
Returns the root of this actor, e.g., the group at the highest level.ScopeHandler
getScopeHandler()
Returns the scope handler for this actor.boolean
getSilent()
Returns whether to suppress output in the console.boolean
getSkip()
Returns whether transformation is skipped.boolean
getStopFlowOnError()
Returns whether to stop the flow execution at this level in case this actor encounters an error.String
getStopMessage()
Returns the stop message.StorageHandler
getStorageHandler()
Returns the storage handler to use.Variables
getVariables()
Returns the Variables instance to use.String
handleError(Actor source, String type, String msg)
Handles the given error message with the flow that this actor belongs to, if the flow has error logging turned on.protected String
handleException(String msg, Throwable t)
Outputs the stacktrace along with the message on stderr and returns a combination of both of them as string.boolean
hasErrorHandler()
Checks if an error handler is set.boolean
hasStopMessage()
Returns whether a stop message is available (in case the flow was stopped with a message).int
index()
Returns the index of this actor in its parent's collection.protected void
initialize()
Initializes the members.protected boolean
isBackedUp(String key)
Checks whether a specified key is present in the current backup state.boolean
isExecuted()
Returns whether the actor has been executed, after setting it up.boolean
isExecuting()
Returns whether the actor is currently being executed, i.e., processing some data or similar.boolean
isFinished()
Returns whether the item has finished.boolean
isHeadless()
Returns whether the actor is run in headless mode.boolean
isStopped()
Returns whether the execution was stopped.String
nameTipText()
Returns the tip text for this property.protected String
performSetUpChecks(boolean fromSetUp)
Hook for performing setup checks -- used in setUp() and preExecute().protected String
performVariableChecks()
For performing variable checks.protected String
postExecute()
Post-execute hook.protected String
preExecute()
Pre-execute hook.protected void
pruneBackup()
Removes entries from the backup.protected void
pruneBackup(String key)
Removes the object with the specified key from the current backup state.protected void
reset()
Resets the scheme.protected void
restoreState(Hashtable<String,Object> state)
Restores the state of the actor before the variables got updated.void
setAnnotations(BaseAnnotation value)
Sets the annoations.void
setErrorHandler(ErrorHandler value)
Sets the error handler to use for handling errors in the flow.void
setName(String value)
Sets the name of the actor.void
setParent(Actor value)
Sets the parent of this actor, e.g., the group it belongs to.void
setSilent(boolean value)
Sets whether to suppress output in the console.void
setSkip(boolean value)
Sets whether the transformation is skipped or not.void
setStopFlowOnError(boolean value)
Sets whether to stop the flow execution at this level in case this actor encounters an error.String
setUp()
Initializes the item for flow execution.void
setVariables(Variables value)
Updates the Variables instance in use, if different from current one.Actor
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.Actor
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.String
silentTipText()
Returns the tip text for this property.int
sizeOf()
Returns the size of the object.String
skipTipText()
Returns the tip text for this property.void
stopExecution()
Stops the execution.void
stopExecution(String msg)
Stops the execution.String
stopFlowOnErrorTipText()
Returns the tip text for this property.protected void
updateDetectedVariables()
Updates the detected variables.protected void
updatePrefix()
Updates the prefix of the logger.protected String
updateVariables()
Gets called when the actor needs to be re-setUp when a variable changes.void
variableChanged(VariableChangeEvent e)
Gets triggered when a variable changed (added, modified, removed).void
wrapUp()
Cleans up after the execution has finished.-
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
toCommandLine
-
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
-
-
-
-
Field Detail
-
m_Self
protected Actor m_Self
the actor itself.
-
m_Name
protected String m_Name
the name of the actor.
-
m_FullName
protected String m_FullName
the full name of the actor.
-
m_LoggingPrefix
protected String m_LoggingPrefix
the logging prefix.
-
m_Parent
protected transient Actor m_Parent
the parent actor this actor is part of, e.g., a sequence.
-
m_Executed
protected boolean m_Executed
whether the actor was executed at least once after setup.
-
m_Executing
protected boolean m_Executing
whether the actor is currently being executed.
-
m_Stopped
protected boolean m_Stopped
whether the execution was stopped.
-
m_StopMessage
protected String m_StopMessage
the message that was used when stopping the execution.
-
m_Annotations
protected BaseAnnotation m_Annotations
annotations for the actor.
-
m_Skip
protected boolean m_Skip
whether to skip the transformation and just forward the token.
-
m_StopFlowOnError
protected boolean m_StopFlowOnError
whether to stop the flow in case of an error.
-
m_Silent
protected boolean m_Silent
whether to suppress output in the console.
-
m_DetectedVariables
protected HashSet<String> m_DetectedVariables
the variable names that are used within this actor.
-
m_DetectedObjectVariables
protected HashSet<String> m_DetectedObjectVariables
the variable names (referencing callable actors or storage) that are used within this actor.
-
m_VariablesUpdated
protected HashSet<String> m_VariablesUpdated
whether the actor needs re-setting up because of modified variables.
-
m_BackupState
protected Hashtable<String,Object> m_BackupState
for backing up the state of an actor.
-
m_StorageHandler
protected StorageHandler m_StorageHandler
the storage handler.
-
m_ScopeHandler
protected ScopeHandler m_ScopeHandler
the scope handler.
-
m_ErrorHandler
protected ErrorHandler m_ErrorHandler
the error handler to use.
-
m_ExecutionListeningSupporter
protected FlowExecutionListeningSupporter m_ExecutionListeningSupporter
the flow execution handler.
-
-
Method Detail
-
getAdditionalInformation
public String getAdditionalInformation()
Returns the additional information.- Specified by:
getAdditionalInformation
in interfaceAdditionalInformationHandler
- Returns:
- the additional information
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractOptionHandler
-
configureLogger
protected void configureLogger()
Initializes the logger.- Overrides:
configureLogger
in classLoggingObject
-
updatePrefix
protected void updatePrefix()
Updates the prefix of the logger.
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
getDefaultName
public String getDefaultName()
Returns the default name of the actor.- Specified by:
getDefaultName
in interfaceActor
- Returns:
- the default name
-
isHeadless
public boolean isHeadless()
Returns whether the actor is run in headless mode.- Specified by:
isHeadless
in interfaceActor
- Returns:
- true if GUI components are suppressed
-
setName
public void setName(String value)
Sets the name of the actor.
-
getName
public String getName()
Returns the name of the actor.
-
nameTipText
public String nameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAnnotations
public void setAnnotations(BaseAnnotation value)
Sets the annoations.- Specified by:
setAnnotations
in interfaceActor
- Parameters:
value
- the annotations
-
getAnnotations
public BaseAnnotation getAnnotations()
Returns the current annotations.- Specified by:
getAnnotations
in interfaceActor
- Returns:
- the annotations
-
annotationsTipText
public String annotationsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setSkip
public void setSkip(boolean value)
Sets whether the transformation is skipped or not.
-
getSkip
public boolean getSkip()
Returns whether transformation is skipped.
-
skipTipText
public String skipTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setStopFlowOnError
public void setStopFlowOnError(boolean value)
Sets whether to stop the flow execution at this level in case this actor encounters an error.- Specified by:
setStopFlowOnError
in interfaceActor
- Parameters:
value
- true if flow gets stopped in case of an error
-
getStopFlowOnError
public boolean getStopFlowOnError()
Returns whether to stop the flow execution at this level in case this actor encounters an error.- Specified by:
getStopFlowOnError
in interfaceActor
- Returns:
- true if flow gets stopped in case of an error
-
stopFlowOnErrorTipText
public String stopFlowOnErrorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSilent
public void setSilent(boolean value)
Sets whether to suppress output in the console. Note: the enclosing actor handler needs to have this enabled as well.
-
getSilent
public boolean getSilent()
Returns whether to suppress output in the console. Note: the enclosing actor handler needs to have this enabled as well.
-
silentTipText
public String silentTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
handleError
public String handleError(Actor source, String type, String msg)
Handles the given error message with the flow that this actor belongs to, if the flow has error logging turned on. Might stop the flow as well.- Specified by:
handleError
in interfaceActor
- Specified by:
handleError
in interfaceErrorHandler
- Parameters:
source
- the source of the errortype
- the type of errormsg
- the error message to log- Returns:
- null if error has been handled, otherwise the error message
- See Also:
Flow.getLogErrors()
,Flow.getErrorHandling()
,getStopFlowOnError()
-
handleException
protected String handleException(String msg, Throwable t)
Outputs the stacktrace along with the message on stderr and returns a combination of both of them as string.- Parameters:
msg
- the message for the exceptiont
- the exception- Returns:
- the full error message (message + stacktrace)
-
setParent
public void setParent(Actor value)
Sets the parent of this actor, e.g., the group it belongs to.
-
getParent
public Actor getParent()
Returns the parent of this actor, e.g., the group.
-
getParentComponent
public Component getParentComponent()
Returns the current parent component for interactive actors.- Specified by:
getParentComponent
in interfaceActor
- Returns:
- the parent, null if not set
-
index
public int index()
Returns the index of this actor in its parent's collection.
-
getRoot
public Actor getRoot()
Returns the root of this actor, e.g., the group at the highest level.
-
updateDetectedVariables
protected void updateDetectedVariables()
Updates the detected variables.
-
forceVariables
protected void forceVariables(Variables value)
Updates the Variables instance in use.
Use with caution!- Parameters:
value
- the instance to use
-
setVariables
public void setVariables(Variables value)
Updates the Variables instance in use, if different from current one.
Use with caution!- Specified by:
setVariables
in interfaceActor
- Parameters:
value
- the instance to use- See Also:
forceVariables(Variables)
-
getVariables
public Variables getVariables()
Returns the Variables instance to use.- Specified by:
getVariables
in interfaceActor
- Returns:
- the variables instance
-
getStorageHandler
public StorageHandler getStorageHandler()
Returns the storage handler to use.- Specified by:
getStorageHandler
in interfaceActor
- Returns:
- the storage handler
-
getScopeHandler
public ScopeHandler getScopeHandler()
Returns the scope handler for this actor.- Specified by:
getScopeHandler
in interfaceActor
- Returns:
- the scope handler
-
getFlowExecutionListeningSupporter
public FlowExecutionListeningSupporter getFlowExecutionListeningSupporter()
Returns the flow execution handler in use.- Specified by:
getFlowExecutionListeningSupporter
in interfaceActor
- Returns:
- the execution handler
-
getFullName
public String getFullName()
Returns the full name of the actor, i.e., the concatenated names of all parents. Used in error messages.- Specified by:
getFullName
in interfaceActor
- Returns:
- the full name
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.
Default implementation returns null.- Specified by:
getQuickInfo
in interfaceActor
- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Returns:
- null if no info available, otherwise short string
-
hasErrorHandler
public boolean hasErrorHandler()
Checks if an error handler is set.- Specified by:
hasErrorHandler
in interfaceActor
- Returns:
- true if an error handler is set
-
setErrorHandler
public void setErrorHandler(ErrorHandler value)
Sets the error handler to use for handling errors in the flow.- Specified by:
setErrorHandler
in interfaceActor
- Parameters:
value
- the error handler
-
getErrorHandler
public ErrorHandler getErrorHandler()
Returns the current error handler for handling errors in the flow.- Specified by:
getErrorHandler
in interfaceActor
- Returns:
- the error handler
-
canInspectOptions
public boolean canInspectOptions(Class cls)
Checks whether the class' options can be inspected.
Default implementation returns true.- Specified by:
canInspectOptions
in interfaceVariablesInspectionHandler
- Parameters:
cls
- the class to check- Returns:
- true if it can be inspected, false otherwise
-
findVariables
public HashSet<String> findVariables()
Recursively finds all the variables used in the actor's setup.- Specified by:
findVariables
in interfaceActor
- Returns:
- the variables that were found
-
findVariables
protected HashSet<String> findVariables(Actor actor)
Recursively finds all the variables used in the specified actor's setup.- Parameters:
actor
- the actor to search- Returns:
- the variables that were found
-
variableChanged
public void variableChanged(VariableChangeEvent e)
Gets triggered when a variable changed (added, modified, removed).- Specified by:
variableChanged
in interfaceActor
- Specified by:
variableChanged
in interfaceVariableChangeListener
- Parameters:
e
- the event
-
getDetectedVariables
public HashSet<String> getDetectedVariables()
Returns the variables this actor is responsible for.- Specified by:
getDetectedVariables
in interfaceActor
- Returns:
- the variables
-
setUp
public String setUp()
Initializes the item for flow execution. Also calls the reset() method first before anything else.
-
isBackedUp
protected boolean isBackedUp(String key)
Checks whether a specified key is present in the current backup state.- Parameters:
key
- the key of the object to look for in the backup state- Returns:
- true if key present
-
pruneBackup
protected void pruneBackup(String key)
Removes the object with the specified key from the current backup state.- Parameters:
key
- the key of the object to remove from the backup state
-
pruneBackup
protected void pruneBackup()
Removes entries from the backup.
Default implementation does nothing.- See Also:
reset()
-
backupState
protected Hashtable<String,Object> backupState()
Backs up the current state of the actor before update the variables.
Default implementation only returns an empty hashtable.- Returns:
- the backup
- See Also:
updateVariables()
,restoreState(Hashtable)
-
restoreState
protected void restoreState(Hashtable<String,Object> state)
Restores the state of the actor before the variables got updated.
Default implementation does nothing.- Parameters:
state
- the backup of the state to restore from- See Also:
updateVariables()
,backupState()
-
updateVariables
protected String updateVariables()
Gets called when the actor needs to be re-setUp when a variable changes.- Returns:
- null if everything is fine, otherwise error message
-
canPerformSetUpCheck
protected boolean canPerformSetUpCheck(boolean fromSetUp, String property)
Returns whether a check can be performed currently. Depending on whether a variable is attached to a property the property cannot be checked at setUp() time, but needs to be done at preExecute() time.- Parameters:
fromSetUp
- whether the method has been called from within setUp()property
- the property to check- Returns:
- true if the check can be performed
-
performSetUpChecks
protected String performSetUpChecks(boolean fromSetUp)
Hook for performing setup checks -- used in setUp() and preExecute().
Default implementation performs no checks.- Parameters:
fromSetUp
- whether the method has been called from within setUp()- Returns:
- null if everything OK, otherwise error message
- See Also:
setUp()
,preExecute()
-
performVariableChecks
protected String performVariableChecks()
For performing variable checks.- Returns:
- null if checks passed, otherwise error messages
- See Also:
preExecute()
-
preExecute
protected String preExecute()
Pre-execute hook.
Default implementation checks only whether the actor needs to be setup again due to changes in variables.- Returns:
- null if everything is fine, otherwise error message
-
doExecute
protected abstract String doExecute()
Executes the flow item.- Returns:
- null if everything is fine, otherwise error message
-
postExecute
protected String postExecute()
Post-execute hook.
Default implementation does nothing apart from setting m_Executed to true and only returns null.- Returns:
- null if everything is fine, otherwise error message
- See Also:
m_Executed
-
execute
public String execute()
Executes the flow item.
-
isFinished
public boolean isFinished()
Returns whether the item has finished. Theexecute()
will be called as long as theisFinished()
method returns false.- Specified by:
isFinished
in interfaceActor
- Returns:
- true if finished, false if further calls to execute() are necessary. Default implementation returns always true, i.e., fires only once.
-
finalUpdateVariables
protected void finalUpdateVariables()
Gets called when the actor needs to re-evaluate variables before wrapping up.
-
wrapUp
public void wrapUp()
Cleans up after the execution has finished. Graphical output is left untouched.
-
cleanUp
public void cleanUp()
Cleans up after the execution has finished. Also removes graphical components.- Specified by:
cleanUp
in interfaceActor
- Specified by:
cleanUp
in interfaceCleanUpHandler
-
destroy
public void destroy()
Frees up memory in a "destructive" non-reversible way.
Calls cleanUp().- Specified by:
destroy
in interfaceActor
- Specified by:
destroy
in interfaceDestroyable
- Overrides:
destroy
in classAbstractOptionHandler
- See Also:
AbstractOptionHandler.cleanUpOptions()
-
stopExecution
public void stopExecution()
Stops the execution. No message set.- Specified by:
stopExecution
in interfaceActor
- Specified by:
stopExecution
in interfaceStoppable
-
stopExecution
public void stopExecution(String msg)
Stops the execution.- Specified by:
stopExecution
in interfaceActor
- Parameters:
msg
- the message to set as reason for stopping, can be null
-
isStopped
public boolean isStopped()
Returns whether the execution was stopped.- Specified by:
isStopped
in interfaceActor
- Specified by:
isStopped
in interfaceStoppableWithFeedback
- Returns:
- true if the execution was stopped
-
hasStopMessage
public boolean hasStopMessage()
Returns whether a stop message is available (in case the flow was stopped with a message).- Specified by:
hasStopMessage
in interfaceActor
- Returns:
- true if a message is available
-
getStopMessage
public String getStopMessage()
Returns the stop message.- Specified by:
getStopMessage
in interfaceActor
- Returns:
- the message, can be null
-
isExecuted
public boolean isExecuted()
Returns whether the actor has been executed, after setting it up.- Specified by:
isExecuted
in interfaceActor
- Returns:
- true if the actor has been executed
-
isExecuting
public boolean isExecuting()
Returns whether the actor is currently being executed, i.e., processing some data or similar.- Returns:
- true if currently active
-
getPreviousSibling
public Actor getPreviousSibling()
If the actor is part of a group, this method returns the actor preceding it in that group.- Specified by:
getPreviousSibling
in interfaceActor
- Returns:
- the preceding actor, null if not available
-
getNextSibling
public Actor getNextSibling()
If the actor is part of a group, this method returns the actor following it in that group.- Specified by:
getNextSibling
in interfaceActor
- Returns:
- the following actor, null if not available
-
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 interfaceActor
- 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 Actor shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceActor
- Specified by:
shallowCopy
in interfaceShallowCopySupporter<Actor>
- Returns:
- the shallow copy
-
shallowCopy
public Actor shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceActor
- Specified by:
shallowCopy
in interfaceShallowCopySupporter<Actor>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
sizeOf
public int sizeOf()
Returns the size of the object.- Specified by:
sizeOf
in interfaceActor
- Specified by:
sizeOf
in interfaceSizeOfHandler
- Overrides:
sizeOf
in classLoggingObject
- Returns:
- the size of the object
-
getFlowActors
public static String[] getFlowActors()
Returns a list with classnames of items.- Returns:
- the item classnames
-
forName
public static Actor forName(String classname, String[] options)
Instantiates the item with the given options.- Parameters:
classname
- the classname of the item to instantiateoptions
- the options for the item- Returns:
- the instantiated item or null if an error occurred
-
forName
public static Actor forName(String classname, String[] options, boolean quiet)
Instantiates the item with the given options.- Parameters:
classname
- the classname of the item to instantiateoptions
- the options for the itemquiet
- whether to suppress error messages- Returns:
- the instantiated item or null if an error occurred
-
forCommandLine
public static Actor forCommandLine(String cmdline)
Instantiates the item from the given commandline (i.e., classname and optional options).- Parameters:
cmdline
- the classname (and optional options) of the item to instantiate- Returns:
- the instantiated item or null if an error occurred
-
-