Class AsyncAppenderEventDispatcher

  • All Implemented Interfaces:
    java.lang.Runnable

    class AsyncAppenderEventDispatcher
    extends Log4jThread
    • Nested Class Summary

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void dispatch​(LogEvent event)
      Dispatches the given event to the registered appenders in the current thread.
      private void dispatchAll()  
      private void dispatchRemaining()  
      (package private) java.util.List<Appender> getAppenders()
      Gets all Appenders.
      void run()  
      (package private) void stop​(long timeoutMillis)  
      • 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

      • STOP_EVENT

        private static final LogEvent STOP_EVENT
      • THREAD_COUNTER

        private static final java.util.concurrent.atomic.AtomicLong THREAD_COUNTER
      • LOGGER

        private static final Logger LOGGER
      • queue

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

        private final java.util.concurrent.atomic.AtomicBoolean stoppedRef
    • Constructor Detail

      • AsyncAppenderEventDispatcher

        AsyncAppenderEventDispatcher​(java.lang.String name,
                                     AppenderControl errorAppender,
                                     java.util.List<AppenderControl> appenders,
                                     java.util.concurrent.BlockingQueue<LogEvent> queue)
    • Method Detail

      • getAppenders

        java.util.List<Appender> getAppenders()
        Gets all Appenders.
        Returns:
        a list of Appenders.
      • run

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

        private void dispatchAll()
      • dispatchRemaining

        private void dispatchRemaining()
      • dispatch

        void dispatch​(LogEvent event)
        Dispatches the given event to the registered appenders in the current thread.
      • stop

        void stop​(long timeoutMillis)
           throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException