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.MetricsNested 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidlistenForLifecycleChanges(Lifecycle lifecycle) protected booleanIndicates if the reader should read from the message queue or if it should currently pause reading.protected voidshutDown()protected voidstartUp()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, triggerShutdownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
startUpin classcom.google.common.util.concurrent.AbstractExecutionThreadService- Throws:
Exception
-
shutDown
- Overrides:
shutDownin 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.
-