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

    Constructors
    Constructor
    Description
    AbstractMessageQueueReader(com.google.common.eventbus.EventBus eventBus)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected boolean
    Indicates if the reader should read from the message queue or if it should currently pause reading.
    protected void
     
    protected void
     

    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

      protected void startUp() throws Exception
      Overrides:
      startUp in class com.google.common.util.concurrent.AbstractExecutionThreadService
      Throws:
      Exception
    • shutDown

      protected void shutDown() throws Exception
      Overrides:
      shutDown in class com.google.common.util.concurrent.AbstractExecutionThreadService
      Throws:
      Exception
    • listenForLifecycleChanges

      public void listenForLifecycleChanges(Lifecycle lifecycle)
    • 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.