Class QueueInit

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, StorageUpdater, Actor, CallableActorUser, ErrorHandler, Serializable, Comparable

    public class QueueInit
    extends AbstractStandalone
    implements StorageUpdater, CallableActorUser
    Creates an empty queue in internal storage under the specified name.

    -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: QueueInit
     
    -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 gets stopped in case this actor encounters an error;
         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
     
    -storage-name <adams.flow.control.StorageName> [-storage-name ...] (property: storageName)
        The name(s) of the queue(s) in the internal storage.
        default: queue
     
    -keep-existing <boolean> (property: keepExisting)
        If enabled, existing queues won't get re-initialized.
        default: false
     
    -limit <int> (property: limit)
        The limit of the queue; use <= 0 for unlimited size.
        default: -1
        minimum: -1
     
    -log <adams.flow.core.CallableActorReference> (property: log)
        The name of the (optional) callable actor to use for logging errors of type 
        adams.db.LogEntry.
        default: unknown
     
    -monitor <adams.flow.core.CallableActorReference> (property: monitor)
        The name of the (optional) callable actor to use for monitoring; generates 
        tokens of type adams.db.LogEntry.
        default: unknown
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • BACKUP_MONITORACTOR

        public static final String BACKUP_MONITORACTOR
        the key for backing up the monitoring actor.
        See Also:
        Constant Field Values
      • m_StorageName

        protected StorageName[] m_StorageName
        the name(s) of the queue in the internal storage.
      • m_KeepExisting

        protected boolean m_KeepExisting
        whether to keep existing queues.
      • m_Limit

        protected int m_Limit
        the limit of the queue (<= 0 is unlimited).
      • m_LogActor

        protected Actor m_LogActor
        the log actor.
      • m_MonitorActor

        protected Actor m_MonitorActor
        the monitor actor.
    • Constructor Detail

      • QueueInit

        public QueueInit()
    • Method Detail

      • reset

        protected void reset()
        Resets the scheme.
        Overrides:
        reset in class AbstractActor
      • isUpdatingStorage

        public boolean isUpdatingStorage()
        Returns whether storage items are being updated.
        Specified by:
        isUpdatingStorage in interface StorageUpdater
        Returns:
        true if storage items are updated
      • setStorageName

        public void setStorageName​(StorageName[] value)
        Sets the names for the queue in the internal storage.
        Parameters:
        value - the names
      • getStorageName

        public StorageName[] getStorageName()
        Returns the names for the queue in the internal storage.
        Returns:
        the names
      • storageNameTipText

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

        public void setKeepExisting​(boolean value)
        Sets whether to keep any existing queue rather than overwriting it.
        Parameters:
        value - true if to keep existing
      • getKeepExisting

        public boolean getKeepExisting()
        Returns whether to keep any existing queue rather than overwriting it.
        Returns:
        true if to keep existing
      • keepExistingTipText

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

        public void setLimit​(int value)
        Sets the limit of the queue.
        Parameters:
        value - the limit, <=0 for unlimited
      • getLimit

        public int getLimit()
        Returns the limit of the queue.
        Returns:
        the limit, <=0 is unlimited
      • limitTipText

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

        public void setLog​(CallableActorReference value)
        Sets the name of the callable actor to use for logging errors.
        Parameters:
        value - the callable name
      • getLog

        public CallableActorReference getLog()
        Returns the name of the callable actor in use for logging errors.
        Returns:
        the callable name
      • logTipText

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

        public void setMonitor​(CallableActorReference value)
        Sets the name of the callable actor to use for monitoring.
        Parameters:
        value - the callable name
      • getMonitor

        public CallableActorReference getMonitor()
        Returns the name of the callable actor in use for monitoring.
        Returns:
        the callable name
      • monitorTipText

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

        protected Actor findCallableActor​(CallableActorReference name)
        Tries to find the callable actor referenced by its callable name.
        Parameters:
        name - the name of the actor
        Returns:
        the callable actor or null if not found
      • getCallableActor

        public Actor getCallableActor()
        Returns the currently set callable actor.
        Specified by:
        getCallableActor in interface CallableActorUser
        Returns:
        the actor, can be null
      • doExecute

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