Class AbstractEnqueueGuard

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.core.Stoppable, adams.core.StoppableWithFeedback, Serializable
    Direct Known Subclasses:
    MaxQueueSize, PassThrough

    public abstract class AbstractEnqueueGuard
    extends adams.core.option.AbstractOptionHandler
    implements adams.core.StoppableWithFeedback
    Ancestor for queue guards.
    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_Stopped
      whether the scheme has been stopped.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract String doEnqueue​(adams.flow.control.StorageQueueHandler handler, Object input, long retrievalDelay)
      Enqueues the object if possible.
      String enqueue​(adams.flow.control.StorageQueueHandler handler, Object input)
      Enqueues the object if possible.
      String enqueue​(adams.flow.control.StorageQueueHandler handler, Object input, long retrievalDelay)
      Enqueues the object if possible.
      boolean isStopped()
      Whether the execution has been stopped.
      void stopExecution()
      Stops the execution.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_Stopped

        protected boolean m_Stopped
        whether the scheme has been stopped.
    • Constructor Detail

      • AbstractEnqueueGuard

        public AbstractEnqueueGuard()
    • Method Detail

      • doEnqueue

        protected abstract String doEnqueue​(adams.flow.control.StorageQueueHandler handler,
                                            Object input,
                                            long retrievalDelay)
        Enqueues the object if possible.
        Parameters:
        handler - the queue to use
        input - the data to queue
        retrievalDelay - the retrieval delay to impose
        Returns:
        null if successful, otherwise error message
      • enqueue

        public String enqueue​(adams.flow.control.StorageQueueHandler handler,
                              Object input)
        Enqueues the object if possible.
        Parameters:
        handler - the queue to use
        input - the data to queue
        Returns:
        null if successful, otherwise error message
      • enqueue

        public String enqueue​(adams.flow.control.StorageQueueHandler handler,
                              Object input,
                              long retrievalDelay)
        Enqueues the object if possible.
        Parameters:
        handler - the queue to use
        input - the data to queue
        Returns:
        null if successful, otherwise error message
      • stopExecution

        public void stopExecution()
        Stops the execution.
        Specified by:
        stopExecution in interface adams.core.Stoppable
      • isStopped

        public boolean isStopped()
        Whether the execution has been stopped.
        Specified by:
        isStopped in interface adams.core.StoppableWithFeedback
        Returns:
        true if stopped