Package org.graylog2.shared.messageq
Class AbstractMessageQueueReader
java.lang.Object
com.google.common.util.concurrent.AbstractExecutionThreadService
org.graylog2.shared.messageq.AbstractMessageQueueReader
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
,MessageQueueReader
- Direct Known Subclasses:
LocalKafkaMessageQueueReader
public abstract class AbstractMessageQueueReader
extends com.google.common.util.concurrent.AbstractExecutionThreadService
implements MessageQueueReader
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.graylog2.shared.messageq.MessageQueueReader
MessageQueueReader.Metrics
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
listenForLifecycleChanges
(Lifecycle lifecycle) protected boolean
Indicates if the reader should read from the message queue or if it should currently pause reading.protected void
shutDown()
protected void
startUp()
Methods inherited from class com.google.common.util.concurrent.AbstractExecutionThreadService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, run, serviceName, startAsync, state, stopAsync, toString, triggerShutdown
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.common.util.concurrent.Service
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync
-
Constructor Details
-
AbstractMessageQueueReader
public AbstractMessageQueueReader(com.google.common.eventbus.EventBus eventBus)
-
-
Method Details
-
startUp
- Overrides:
startUp
in classcom.google.common.util.concurrent.AbstractExecutionThreadService
- Throws:
Exception
-
shutDown
- Overrides:
shutDown
in classcom.google.common.util.concurrent.AbstractExecutionThreadService
- Throws:
Exception
-
listenForLifecycleChanges
-
shouldBeReading
protected boolean shouldBeReading()Indicates if the reader should read from the message queue or if it should currently pause reading. The returned value is affected by lifecycle changes, e.g. during server startup or when processing has stopped it will be false, during normal operation mode it will be true.
-