Class AsyncLoggerDisruptor

java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.apache.logging.log4j.async.logger.AsyncLoggerDisruptor
All Implemented Interfaces:
LifeCycle

public class AsyncLoggerDisruptor extends AbstractLifeCycle
Helper class for async loggers: AsyncLoggerDisruptor handles the mechanics of working with the LMAX Disruptor, and works with its associated AsyncLoggerContext to synchronize the life cycle of the Disruptor and its thread with the life cycle of the context. The AsyncLoggerDisruptor of the context is shared by all AsyncLogger objects created by that AsyncLoggerContext.
  • Constructor Details

  • Method Details

    • getContextName

      public String getContextName()
    • setContextName

      public void setContextName(String name)
    • start

      public void start()
      Creates and starts a new Disruptor and associated thread if none currently exists.
      Specified by:
      start in interface LifeCycle
      Overrides:
      start in class AbstractLifeCycle
      See Also:
    • stop

      public boolean stop(long timeout, TimeUnit timeUnit)
      Decreases the reference count. If the reference count reached zero, the Disruptor and its associated thread are shut down and their references set to null.
      Specified by:
      stop in interface LifeCycle
      Overrides:
      stop in class AbstractLifeCycle