Class AsyncAppender.AsyncThread

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    AsyncAppender

    private class AsyncAppender.AsyncThread
    extends Log4jThread
    Thread that calls the Appenders.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<AppenderControl> appenders  
      private java.util.concurrent.BlockingQueue<LogEvent> queue  
      private boolean shutdown  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      AsyncThread​(java.util.List<AppenderControl> appenders, java.util.concurrent.BlockingQueue<LogEvent> queue)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) boolean callAppenders​(LogEvent event)
      Calls callAppender on all registered AppenderControl objects, and returns true if at least one appender call was successful, false otherwise.
      void run()  
      void shutdown()  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • shutdown

        private volatile boolean shutdown
      • queue

        private final java.util.concurrent.BlockingQueue<LogEvent> queue
    • Constructor Detail

      • AsyncThread

        public AsyncThread​(java.util.List<AppenderControl> appenders,
                           java.util.concurrent.BlockingQueue<LogEvent> queue)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • callAppenders

        boolean callAppenders​(LogEvent event)
        Calls callAppender on all registered AppenderControl objects, and returns true if at least one appender call was successful, false otherwise. Any exceptions are silently ignored.
        Parameters:
        event - the event to forward to the registered appenders
        Returns:
        true if at least one appender call succeeded, false otherwise
      • shutdown

        public void shutdown()