com.tibbo.aggregate.common.context

## Class EventDispatcher

- java.lang.Object
- - java.lang.Thread
  - - com.tibbo.aggregate.common.context.EventDispatcher

- All Implemented Interfaces:
    java.lang.Runnable

      public class EventDispatcher
      extends java.lang.Thread

- - ### 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 and Description
    --- | ---
    `static int` | `CONCURRENT_DISPATCHER_KEEP_ALIVE_SECONDS`
    `static int` | `DEFAULT_DISPATCHER_POOL_SIZE`

    - ### Fields inherited from class java.lang.Thread

      `MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EventDispatcher(int queueLength, java.util.function.Supplier<java.util.concurrent.ThreadPoolExecutor> concurrentDispatcherSupplier)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.concurrent.ThreadPoolExecutor` | `createConcurrentEventDispatcherPool(int coreSize, int maxCoreSize, int queueLength, java.lang.String parentThreadName)`
    `java.util.Map<java.lang.String,java.lang.Long>` | `getEventQueueStatistics()`
    `long` | `getEventsProcessed()`
    `long` | `getEventsScheduled()`
    `int` | `getQueueLength()`
    `void` | `queue(QueuedEvent ev, FireEventRequestController request)`
    `void` | `registerIncomingEvent()`
    `void` | `registerProcessedEvent()`
    `void` | `run()`

    - ### Methods inherited from class java.lang.Thread

      `activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### CONCURRENT_DISPATCHER_KEEP_ALIVE_SECONDS

          public static final int CONCURRENT_DISPATCHER_KEEP_ALIVE_SECONDS

      See Also:
        Constant Field Values

    - #### DEFAULT_DISPATCHER_POOL_SIZE

          public static final int DEFAULT_DISPATCHER_POOL_SIZE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EventDispatcher

          public EventDispatcher(int queueLength,
                                 java.util.function.Supplier<java.util.concurrent.ThreadPoolExecutor> concurrentDispatcherSupplier)

  - ### Method Detail

    - #### createConcurrentEventDispatcherPool

          public static java.util.concurrent.ThreadPoolExecutor createConcurrentEventDispatcherPool(int coreSize,
                                                                                                    int maxCoreSize,
                                                                                                    int queueLength,
                                                                                                    java.lang.String parentThreadName)

    - #### queue

          public void queue(QueuedEvent ev,
                            FireEventRequestController request)
                     throws java.lang.InterruptedException

      Throws:
        `java.lang.InterruptedException`

    - #### run

          public void run()

      Specified by:
        `run` in interface `java.lang.Runnable`
      Overrides:
        `run` in class `java.lang.Thread`

    - #### getQueueLength

          public int getQueueLength()

    - #### getEventsProcessed

          public long getEventsProcessed()

    - #### getEventsScheduled

          public long getEventsScheduled()

    - #### getEventQueueStatistics

          public java.util.Map<java.lang.String,java.lang.Long> getEventQueueStatistics()

    - #### registerIncomingEvent

          public void registerIncomingEvent()

    - #### registerProcessedEvent

          public void registerProcessedEvent()