org.appng.api.messaging

## Class EventRegistry

- java.lang.Object
- - org.appng.api.messaging.EventRegistry

-     public class EventRegistry
      extends Object

  A registry for `EventHandler`s to be used by `Receiver` implementations.
  Author:
    @author Matthias Müller
  See Also:
    `Receiver.setDefaultHandler(EventHandler)`, `Receiver.registerHandler(EventHandler)`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EventRegistry()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<E extends Event,H extends EventHandler<E>> List<H>` | `getHandlers(E event)` Retrieves a list of `EventHandler`s that have been registered for the given type of `Event`.
    `<E extends Event,H extends EventHandler<E>> void` | `register(H handler)` Registers the given `EventHandler`
    `void` | `setDefaultHandler(EventHandler<? extends Event> defaultHandler)` Set the default `EventHandler`

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

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

- - ### Constructor Detail

    - #### EventRegistry

          public EventRegistry()

  - ### Method Detail

    - #### register

          public <E extends Event,H extends EventHandler<E>> void register(H handler)

      Registers the given `EventHandler`
      Parameters:
        `handler` - the `EventHandler` to be registered

    - #### getHandlers

          public <E extends Event,H extends EventHandler<E>> List<H> getHandlers(E event)

      Retrieves a list of `EventHandler`s that have been registered for the given type of `Event`. If no such handlers have been registered, the list will only contain the default handler.
      Parameters:
        `event` - the `Event` to retrieve the `EventHandler`s for
      Returns:
        a list of `EventHandler`s
      See Also:
        `setDefaultHandler(EventHandler)`

    - #### setDefaultHandler

          public void setDefaultHandler(EventHandler<? extends Event> defaultHandler)

      Set the default `EventHandler`
      Parameters:
        `defaultHandler` - the default `EventHandler`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.