com.h3c.util.event

## Interface EventSinkBroker

- All Known Subinterfaces:
    EventDispatchService
  All Known Implementing Classes:
    DefaultEventSinkBroker

      public interface EventSinkBroker

  Broker for registering various event sinks capable of handling designated event types.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSink(Class<? extends Event> eventClass, EventSink sink)` Adds a new event sink associated with the specified event class.
    `EventSink` | `get(Class<? extends Event> eventClass)` Get the event sink associated with the given event class.
    `void` | `removeSink(Class<? extends Event> eventClass)` Removes a previously added event sink.

- - ### Method Detail

    - #### addSink

          void addSink(Class<? extends Event> eventClass,
                     EventSink sink)

      Adds a new event sink associated with the specified event class.
      Parameters:
        `eventClass` - class of events handled by the sink
        `sink` - event sink
      Throws:
        `IllegalStateException` - if the event class already has a sink

    - #### get

          EventSink get(Class<? extends Event> eventClass)

      Get the event sink associated with the given event class.
      Parameters:
        `eventClass` - class of events
      Returns:
        event sink; null if no sink has been registered for the class

    - #### removeSink

          void removeSink(Class<? extends Event> eventClass)

      Removes a previously added event sink.
      Parameters:
        `eventClass` - class of events handled by the sink
      Throws:
        `IllegalStateException` - if the given sink is not found

Copyright © 2014. All Rights Reserved.