Class 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 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.
    • Constructor Detail

      • CallableActor

        public CallableActor()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.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 interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • reset

        protected void reset()
        Resets the scheme.
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • 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 interface adams.flow.core.OptionalCallableActor
        Parameters:
        value - true if optional
      • getOptional

        public boolean getOptional()
        Returns whether the callable actor is optional.
        Specified by:
        getOptional in interface adams.flow.core.OptionalCallableActor
        Returns:
        true if optional
      • optionalTipText

        public String optionalTipText()
        Returns the tip text for this property.
        Specified by:
        optionalTipText in interface adams.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 interface adams.core.QuickInfoSupporter
        Overrides:
        getQuickInfo in class AbstractRatOutput
        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 interface adams.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 interface RatOutput
        Specified by:
        accepts in class AbstractRatOutput
        Returns:
        the classes that the consumer accepts
      • doTransmit

        protected String doTransmit()
        Performs the actual transmission.
        Specified by:
        doTransmit in class AbstractRatOutput
        Returns:
        null if successful, otherwise error message