Class RatPlague

  • 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.Pausable, adams.core.QuickInfoSupporter, adams.core.ShallowCopySupporter<adams.flow.core.Actor>, adams.core.SizeOfHandler, adams.core.Stoppable, adams.core.StoppableWithFeedback, adams.core.VariablesInspectionHandler, adams.event.FlowPauseStateListener, adams.event.VariableChangeListener, adams.flow.control.AtomicExecution, adams.flow.core.Actor, adams.flow.core.ActorHandler, adams.flow.core.CallableActorUser, adams.flow.core.ErrorHandler, adams.flow.core.Flushable, adams.flow.core.LazySetupSupporter, adams.flow.core.MutableActorHandler, adams.flow.execution.debug.DebugScopeRestrictionHandler, adams.flow.standalone.StandaloneGroupItem<Rats>, Serializable, Comparable

    public class RatPlague
    extends Rat
    Replaces itself at runtime with a copy of itself, as many times as there are input queues.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: RatPlague
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow execution at this level gets stopped in case this 
        actor encounters an error; the error gets propagated; useful for critical 
        actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing 
        actor handler must have this enabled as well.
        default: false
     
    -actor <adams.flow.core.Actor> [-actor ...] (property: actors)
        The actors for transforming the data obtained by the receiver before sending 
        it to the transmitter.
        default: 
     
    -log <adams.flow.core.CallableActorReference> (property: log)
        The name of the callable log actor to use (logging disabled if actor not 
        found).
        default: unknown
     
    -scope-handling-variables <EMPTY|COPY|SHARE> (property: scopeHandlingVariables)
        Defines how variables are handled in the local scope; whether to start with 
        empty set, a copy of the outer scope variables or share variables with the 
        outer scope.
        default: EMPTY
     
    -propagate-variables <boolean> (property: propagateVariables)
        If enabled, variables that match the specified regular expression get propagated 
        to the outer scope.
        default: false
     
    -variables-regexp <adams.core.base.BaseRegExp> (property: variablesRegExp)
        The regular expression that variable names must match in order to get propagated.
        default: .*
     
    -scope-handling-storage <EMPTY|COPY|SHARE> (property: scopeHandlingStorage)
        Defines how storage is handled in the local scope; whether to start with 
        empty set, a (deep) copy of the outer scope storage or share the storage 
        with the outer scope.
        default: EMPTY
     
    -propagate-storage <boolean> (property: propagateStorage)
        If enabled, storage items which names match the specified regular expression 
        get propagated to the outer scope.
        default: false
     
    -storage-regexp <adams.core.base.BaseRegExp> (property: storageRegExp)
        The regular expression that the names of storage items must match in order 
        to get propagated.
        default: .*
     
    -flow-error-queue <adams.flow.control.StorageName> (property: flowErrorQueue)
        The name of the (optional) queue in internal storage to feed with flow errors;
         Forwards the original data received as payload in an adams.flow.container.ErrorContainer 
        alongside the error message.
        default: flowerrors
     
    -send-error-queue <adams.flow.control.StorageName> (property: sendErrorQueue)
        The name of the (optional) queue in internal storage to feed with send errors;
         Forwards the original data received as payload in an adams.flow.container.ErrorContainer 
        alongside the error message.
        default: senderrors
     
    -suppress-errors <boolean> (property: suppressErrors)
        If enabled, errors are suppressed and only forwarded to the log actor.
        default: true
     
    -show-in-control <boolean> (property: showInControl)
        If enabled, this Rat will be displayed in the adams.flow.standalone.RatControl 
        control panel.
        default: false
     
    -initial-state <PAUSED|RUNNING> (property: initialState)
        The initial state of the Rat actor.
        default: RUNNING
     
    -input <adams.flow.control.StorageName> [-input ...] (property: input)
        The names of the input queues in the internal storage.
        default: 
     
    -has-output <boolean> (property: hasOutput)
        If enabled, an output queue is configured.
        default: true
     
    -output <adams.flow.control.StorageName> (property: output)
        The name of the output queue in the internal storage.
        default: queue
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Input

        protected adams.flow.control.StorageName[] m_Input
        the names of the input queues in the internal storage.
      • m_HasOutput

        protected boolean m_HasOutput
        whether to use an output queue.
      • m_Output

        protected adams.flow.control.StorageName m_Output
        the name of the output queue in the internal storage.
      • m_RatsConfigured

        protected boolean m_RatsConfigured
        whether the sub-rats have been set up.
    • Constructor Detail

      • RatPlague

        public RatPlague()
    • Method Detail

      • globalInfo

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

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class Rat
      • setInput

        public void setInput​(adams.flow.control.StorageName[] value)
        Sets the names for the input queues in the internal storage.
        Parameters:
        value - the names
      • getInput

        public adams.flow.control.StorageName[] getInput()
        Returns the names for the input queues in the internal storage.
        Returns:
        the names
      • inputTipText

        public String inputTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setHasOutput

        public void setHasOutput​(boolean value)
        Sets whether an output queue should be used.
        Parameters:
        value - true if to use output queue
      • getHasOutput

        public boolean getHasOutput()
        Returns whether to use an output queue.
        Returns:
        true if to use output queue
      • hasOutputTipText

        public String hasOutputTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOutput

        public void setOutput​(adams.flow.control.StorageName value)
        Sets the name for the output queues in the internal storage.
        Parameters:
        value - the name
      • getOutput

        public adams.flow.control.StorageName getOutput()
        Returns the name of the input queue in the internal storage.
        Returns:
        the name
      • outputTipText

        public String outputTipText()
        Returns the tip text for this property.
        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.flow.core.Actor
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Overrides:
        getQuickInfo in class Rat
        Returns:
        null if no info available, otherwise short string
      • setUpRats

        protected String setUpRats​(boolean execute)
        Sets up the rats.
        Parameters:
        execute - whether to execute the actors as well, not just setUp them
        Returns:
        null if successfully setup, otherwise error message
      • setUp

        public String setUp()
        Initializes the item for flow execution.
        Specified by:
        setUp in interface adams.flow.core.Actor
        Overrides:
        setUp in class Rat
        Returns:
        null if everything is fine, otherwise error message
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Overrides:
        doExecute in class Rat
        Returns:
        null if everything is fine, otherwise error message