Package adams.flow.standalone
Class RatPlague
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- adams.flow.standalone.AbstractStandalone
-
- adams.flow.standalone.AbstractStandaloneGroupItem<Rats>
-
- adams.flow.standalone.Rat
-
- adams.flow.standalone.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 Summary
Fields Modifier and Type Field Description protected boolean
m_HasOutput
whether to use an output queue.protected adams.flow.control.StorageName[]
m_Input
the names of the input queues in the internal storage.protected adams.flow.control.StorageName
m_Output
the name of the output queue in the internal storage.protected boolean
m_RatsConfigured
whether the sub-rats have been set up.-
Fields inherited from class adams.flow.standalone.Rat
DEFAULT_FLOWERRORS, DEFAULT_LOG, DEFAULT_SENDERRORS, m_Actors, m_BreakpointPresent, m_FlowErrorQueue, m_Helper, m_InitialState, m_LazySetupPeformed, m_Log, m_LogActor, m_LogGenerator, m_Mode, m_PerformLazySetup, m_Receiver, m_Runnable, m_SendErrorQueue, m_ShowInControl, m_StateListeners, m_Stopping, m_SuppressErrors, m_Transmitter, m_WrapUpAfterExecution
-
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
-
-
Constructor Summary
Constructors Constructor Description RatPlague()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected String
doExecute()
Executes the flow item.boolean
getHasOutput()
Returns whether to use an output queue.adams.flow.control.StorageName[]
getInput()
Returns the names for the input queues in the internal storage.adams.flow.control.StorageName
getOutput()
Returns the name of the input queue in the internal storage.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.String
globalInfo()
Returns a string describing the object.String
hasOutputTipText()
Returns the tip text for this property.protected void
initialize()
Initializes the members.String
inputTipText()
Returns the tip text for this property.String
outputTipText()
Returns the tip text for this property.void
setHasOutput(boolean value)
Sets whether an output queue should be used.void
setInput(adams.flow.control.StorageName[] value)
Sets the names for the input queues in the internal storage.void
setOutput(adams.flow.control.StorageName value)
Sets the name for the output queues in the internal storage.String
setUp()
Initializes the item for flow execution.protected String
setUpRats(boolean execute)
Sets up the rats.-
Methods inherited from class adams.flow.standalone.Rat
actorsTipText, add, add, addRatStateListener, check, cleanUp, findCallableActor, finishBeforeStoppingTipText, firstActive, flowErrorQueueTipText, flowPauseStateChanged, flushExecution, forceVariables, get, getActorHandler, getActorHandlerInfo, getActors, getAdditionalInformation, getCallableActor, getDebugScopeRestriction, getDebugScopeRestriction, getFinishBeforeStopping, getFlowErrorQueue, getInitialState, getLocalScope, getLog, getLogGenerator, getMode, getPerformLazySetup, getPropagateStorage, getPropagateVariables, getReceiver, getScopeHandlingStorage, getScopeHandlingVariables, getSendErrorQueue, getShowInControl, getStoppingTimeout, getStoppingWarningInterval, getStorageRegExp, getSuppressErrors, getTransmitter, getVariablesRegExp, getWrapUpAfterExecution, handleError, hasCallableActor, hasLazySetupPerformed, indexOf, initialStateTipText, isBreakpointPresent, isPaused, isRunnableActive, lastActive, lazySetup, log, logGeneratorTipText, logTipText, modeTipText, notifyRatStateListeners, pauseExecution, performLazySetupTipText, performVariableChecks, propagateStorageTipText, propagateVariablesTipText, queueFlowError, queueSendError, receiverTipText, remove, removeAll, removeRatStateListener, resumeExecution, scopeHandlingStorageTipText, scopeHandlingVariablesTipText, sendErrorQueueTipText, set, setActors, setErrorHandler, setFinishBeforeStopping, setFlowErrorQueue, setInitialState, setLog, setLogGenerator, setLoggingLevel, setMode, setParent, setPerformLazySetup, setPropagateStorage, setPropagateVariables, setReceiver, setScopeHandlingStorage, setScopeHandlingVariables, setSendErrorQueue, setShowInControl, setStoppingTimeout, setStoppingWarningInterval, setStorageRegExp, setSuppressErrors, setTransmitter, setVariablesRegExp, setWrapUpAfterExecution, showInControlTipText, size, startRunnable, stopExecution, stopIfNecessary, stoppingTimeoutTipText, stoppingWarningIntervalTipText, stopRunnable, storageRegExpTipText, suppressErrorsTipText, transmitterTipText, variablesRegExpTipText, wrapUp, wrapUpAfterExecutionTipText, wrapUpRunnable
-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, backupState, canInspectOptions, canPerformSetUpCheck, compareTo, configureLogger, destroy, equals, execute, finalUpdateVariables, findVariables, findVariables, forCommandLine, forName, forName, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleException, hasErrorHandler, hasStopMessage, index, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, postExecute, pruneBackup, pruneBackup, reset, restoreState, setAnnotations, setName, setSilent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, 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
compareTo, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setName, setSilent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, sizeOf, stopExecution, toCommandLine, variableChanged
-
-
-
-
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.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Overrides:
globalInfo
in classRat
- 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 classRat
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classRat
-
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 interfaceadams.flow.core.Actor
- Specified by:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classRat
- 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.
-
-