Class FailureHandlingService

java.lang.Object
com.google.common.util.concurrent.AbstractExecutionThreadService
org.graylog.failure.FailureHandlingService
All Implemented Interfaces:
com.google.common.util.concurrent.Service

@Singleton public class FailureHandlingService extends com.google.common.util.concurrent.AbstractExecutionThreadService
A service consuming and processing failure batches submitted via FailureSubmissionQueue. The processing is done in a dedicated thread, the lifecycle of this service is managed by ServiceManager. This service is designed with an idea of extensibility, so that Graylog plugins can inject custom failure handlers via Multibinder - see FailureHandler. If no custom handlers found, then the fallback one will be picked instead.
  • Nested Class Summary

    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
    FailureHandlingService(FailureHandler fallbackFailureHandler, Set<FailureHandler> failureHandlers, org.graylog.failure.FailureSubmissionQueue failureSubmissionQueue, Configuration configuration, MessageQueueAcknowledger acknowledger)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    run()
     
    protected void
     
    protected void
     
    protected void
     

    Methods inherited from class com.google.common.util.concurrent.AbstractExecutionThreadService

    addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • 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
    • triggerShutdown

      protected void triggerShutdown()
      Overrides:
      triggerShutdown in class com.google.common.util.concurrent.AbstractExecutionThreadService
    • run

      protected void run() throws Exception
      Specified by:
      run in class com.google.common.util.concurrent.AbstractExecutionThreadService
      Throws:
      Exception