Class AbstractEnqueueGuard
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.standalone.rats.output.enqueue.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.
-
Constructor Summary
Constructors Constructor Description AbstractEnqueueGuard()
-
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
-
-
-
-
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 useinput
- the data to queueretrievalDelay
- 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 useinput
- 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 useinput
- the data to queue- Returns:
- null if successful, otherwise error message
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecution
in interfaceadams.core.Stoppable
-
isStopped
public boolean isStopped()
Whether the execution has been stopped.- Specified by:
isStopped
in interfaceadams.core.StoppableWithFeedback
- Returns:
- true if stopped
-
-