com.h3c.util.observer

## Class MultiThreadListenerHandler<T>

- java.lang.Object
- - com.h3c.util.observer.AbstractListenerHandler<T>
  - - com.h3c.util.observer.MultiThreadListenerHandler<T>

- Type Parameters:
    `T` - type of the listener.
  All Implemented Interfaces:
    ListenerHandler<T>, Observable<T>

      public class MultiThreadListenerHandler<T>
      extends AbstractListenerHandler<T>

  Listeners are notified in a different thread than the one notification was sent.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `MultiThreadListenerHandler.ThreadingMode` Thread model.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiThreadListenerHandler(Store<T> listenerStore, MultiThreadListenerHandler.ThreadingMode threadingMode, RunnableExecutor taskExecutor, ErrorHandler<T,Exception> errorHandler)` Creates a new listener handler.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `executeCallback(T listener, Invoker<T> invoker)` Executes a call back method to notify the listener.
    `protected void` | `notify(Collection<T> listenersToNotify, Invoker<T> invoker)` Notifies listeners.

    - ### Methods inherited from class com.h3c.util.observer.AbstractListenerHandler

      `getErrorHandler, notifyListeners, register, unregister`

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

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

- - ### Constructor Detail

    - #### MultiThreadListenerHandler

          public MultiThreadListenerHandler(Store<T> listenerStore,
                                    MultiThreadListenerHandler.ThreadingMode threadingMode,
                                    RunnableExecutor taskExecutor,
                                    ErrorHandler<T,Exception> errorHandler)

      Creates a new listener handler.
      Parameters:
        `listenerStore` - listener store.
        `threadingMode` - threading mode.
        `taskExecutor` - task executor.
        `errorHandler` - error handler used to delegate error handling when notifying a listener.

  - ### Method Detail

    - #### notify

          protected void notify(Collection<T> listenersToNotify,
                    Invoker<T> invoker)

      Description copied from class: `AbstractListenerHandler`
      Notifies listeners.
      Overrides:
        `notify` in class `AbstractListenerHandler<T>`
      Parameters:
        `listenersToNotify` - listeners to notify.
        `invoker` - invoker to use.

    - #### executeCallback

          protected void executeCallback(T listener,
                             Invoker<T> invoker)

      Description copied from class: `AbstractListenerHandler`
      Executes a call back method to notify the listener.
      Specified by:
        `executeCallback` in class `AbstractListenerHandler<T>`
      Parameters:
        `listener` - Listener to notify.
        `invoker` - Invoker to use.

Copyright © 2014. All Rights Reserved.