Class CallableActor
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.standalone.rats.output.AbstractRatOutput
-
- adams.flow.standalone.rats.output.CallableActor
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler
,adams.core.CleanUpHandler
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.QuickInfoSupporter
,adams.core.ShallowCopySupporter<AbstractRatOutput>
,adams.core.SizeOfHandler
,adams.core.Stoppable
,adams.core.StoppableWithFeedback
,adams.event.VariableChangeListener
,adams.flow.core.CallableActorUser
,adams.flow.core.OptionalCallableActor
,RatOutput
,Serializable
public class CallableActor extends AbstractRatOutput implements adams.flow.core.CallableActorUser, adams.flow.core.OptionalCallableActor
Forwards the data to the specified callable actor.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-callable <adams.flow.core.CallableActorReference> (property: callableName) The name of the callable actor to use. default: unknown
-optional <boolean> (property: optional) If enabled, then the callable actor is optional, ie no error is raised if not found, merely ignored. default: false
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.flow.core.Actor
m_CallableActor
the callable actor.protected adams.flow.core.CallableActorReference
m_CallableName
the callable name.protected boolean
m_Configured
whether the callable actor has been configured.protected adams.flow.core.CallableActorHelper
m_Helper
the helper class.protected boolean
m_Optional
whether the callable actor is optional.-
Fields inherited from class adams.flow.standalone.rats.output.AbstractRatOutput
m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_Input, m_LoggingPrefix, m_Owner, m_Stopped, m_VariablesUpdated
-
-
Constructor Summary
Constructors Constructor Description CallableActor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]
accepts()
Returns the class that the consumer accepts.String
callableNameTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected String
doTransmit()
Performs the actual transmission.protected adams.flow.core.Actor
findCallableActor()
Tries to find the callable actor referenced by its callable name.protected HashSet<String>
findVariables(adams.flow.core.Actor actor)
Recursively finds all the variables used in the specified actor's setup.adams.flow.core.Actor
getCallableActor()
Returns the currently set callable actor.adams.flow.core.CallableActorReference
getCallableName()
Returns the name of the callable actor in use.boolean
getOptional()
Returns whether the callable actor is optional.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.String
globalInfo()
Returns a string describing the object.boolean
hasCallableActor()
Checks whether a reference to the callable actor is currently available.protected void
initialize()
Initializes the members.String
optionalTipText()
Returns the tip text for this property.protected void
reset()
Resets the scheme.void
setCallableName(adams.flow.core.CallableActorReference value)
Sets the name of the callable actor to use.void
setOptional(boolean value)
Sets whether the callable actor is optional.protected String
setUpCallableActor()
Configures the callable actor.-
Methods inherited from class adams.flow.standalone.rats.output.AbstractRatOutput
backupState, canInput, check, cleanUp, configureLogger, doWait, findVariables, getAdditionalInformation, getFullName, getOwner, getQueue, getVariables, handleException, initTransmission, input, isBackedUp, isStopped, pruneBackup, pruneBackup, restoreState, setOwner, setUp, shallowCopy, shallowCopy, stopExecution, transmit, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_CallableName
protected adams.flow.core.CallableActorReference m_CallableName
the callable name.
-
m_CallableActor
protected adams.flow.core.Actor m_CallableActor
the callable actor.
-
m_Configured
protected boolean m_Configured
whether the callable actor has been configured.
-
m_Helper
protected adams.flow.core.CallableActorHelper m_Helper
the helper class.
-
m_Optional
protected boolean m_Optional
whether the callable actor is optional.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classadams.core.option.AbstractOptionHandler
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractRatOutput
-
setCallableName
public void setCallableName(adams.flow.core.CallableActorReference value)
Sets the name of the callable actor to use.- Parameters:
value
- the callable name
-
getCallableName
public adams.flow.core.CallableActorReference getCallableName()
Returns the name of the callable actor in use.- Returns:
- the callable name
-
callableNameTipText
public String callableNameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOptional
public void setOptional(boolean value)
Sets whether the callable actor is optional.- Specified by:
setOptional
in interfaceadams.flow.core.OptionalCallableActor
- Parameters:
value
- true if optional
-
getOptional
public boolean getOptional()
Returns whether the callable actor is optional.- Specified by:
getOptional
in interfaceadams.flow.core.OptionalCallableActor
- Returns:
- true if optional
-
optionalTipText
public String optionalTipText()
Returns the tip text for this property.- Specified by:
optionalTipText
in interfaceadams.flow.core.OptionalCallableActor
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractRatOutput
- Returns:
- null if no info available, otherwise short string
-
findCallableActor
protected adams.flow.core.Actor findCallableActor()
Tries to find the callable actor referenced by its callable name.- Returns:
- the callable actor or null if not found
-
hasCallableActor
public boolean hasCallableActor()
Checks whether a reference to the callable actor is currently available.- Returns:
- true if a reference is available
- See Also:
getCallableActor()
-
getCallableActor
public adams.flow.core.Actor getCallableActor()
Returns the currently set callable actor.- Specified by:
getCallableActor
in interfaceadams.flow.core.CallableActorUser
- Returns:
- the actor, can be null
-
findVariables
protected HashSet<String> findVariables(adams.flow.core.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
-
setUpCallableActor
protected String setUpCallableActor()
Configures the callable actor.- Returns:
- null if successful, otherwise error message
-
accepts
public Class[] accepts()
Returns the class that the consumer accepts.- Specified by:
accepts
in interfaceRatOutput
- Specified by:
accepts
in classAbstractRatOutput
- Returns:
- the classes that the consumer accepts
-
doTransmit
protected String doTransmit()
Performs the actual transmission.- Specified by:
doTransmit
in classAbstractRatOutput
- Returns:
- null if successful, otherwise error message
-
-