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.Actorm_CallableActorthe callable actor.protected adams.flow.core.CallableActorReferencem_CallableNamethe callable name.protected booleanm_Configuredwhether the callable actor has been configured.protected adams.flow.core.CallableActorHelperm_Helperthe helper class.protected booleanm_Optionalwhether 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.StringcallableNameTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected StringdoTransmit()Performs the actual transmission.protected adams.flow.core.ActorfindCallableActor()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.ActorgetCallableActor()Returns the currently set callable actor.adams.flow.core.CallableActorReferencegetCallableName()Returns the name of the callable actor in use.booleangetOptional()Returns whether the callable actor is optional.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.StringglobalInfo()Returns a string describing the object.booleanhasCallableActor()Checks whether a reference to the callable actor is currently available.protected voidinitialize()Initializes the members.StringoptionalTipText()Returns the tip text for this property.protected voidreset()Resets the scheme.voidsetCallableName(adams.flow.core.CallableActorReference value)Sets the name of the callable actor to use.voidsetOptional(boolean value)Sets whether the callable actor is optional.protected StringsetUpCallableActor()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:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin 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:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.core.option.AbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classadams.core.option.AbstractOptionHandler
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein 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:
setOptionalin interfaceadams.flow.core.OptionalCallableActor- Parameters:
value- true if optional
-
getOptional
public boolean getOptional()
Returns whether the callable actor is optional.- Specified by:
getOptionalin interfaceadams.flow.core.OptionalCallableActor- Returns:
- true if optional
-
optionalTipText
public String optionalTipText()
Returns the tip text for this property.- Specified by:
optionalTipTextin 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:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin 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:
getCallableActorin 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:
acceptsin interfaceRatOutput- Specified by:
acceptsin classAbstractRatOutput- Returns:
- the classes that the consumer accepts
-
doTransmit
protected String doTransmit()
Performs the actual transmission.- Specified by:
doTransmitin classAbstractRatOutput- Returns:
- null if successful, otherwise error message
-
-