Interface EventHandlerRegistry<S extends EventHandlerRegistry<S>>
- Type Parameters:
S- The type of the registry itself, used for fluent interfacing.
- All Known Implementing Classes:
SimpleEventHandlingComponent
public interface EventHandlerRegistry<S extends EventHandlerRegistry<S>>
Interface describing a registry of
event handlers.- Since:
- 5.0.0
- Author:
- Allard Buijze, Gerard Klijs, Milan Savic, Mitchell Herrijgers, Sara Pellegrini, Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptiondefault Ssubscribe(Set<QualifiedName> names, EventHandler eventHandler) subscribe(QualifiedName name, EventHandler eventHandler) default Ssubscribe(EventHandlingComponent handlingComponent) Subscribe the givenhandlingComponentwith this registry.
-
Method Details
-
subscribe
Subscribe the givenhandlerforeventsof the givennames.If a subscription already exists for any
namein the given set, the behavior is undefined. Implementations may throw an exception to refuse duplicate subscription or alternatively decide whether the existing or newhandlergets the subscription.- Parameters:
names- The names of the givencommandHandlercan handle.eventHandler- The handler instance that handleseventsfor the given names.- Returns:
- This registry for fluent interfacing.
-
subscribe
Subscribe the givenhandlerforeventsof the givenname.If a subscription already exists for the
name, the behavior is undefined. Implementations may throw an exception to refuse duplicate subscription or alternatively decide whether the existing or newhandlergets the subscription.- Parameters:
name- The name the givencommandHandlercan handle.eventHandler- The handler instance that handleseventsfor the given name.- Returns:
- This registry for fluent interfacing.
-
subscribe
Subscribe the givenhandlingComponentwith this registry.Typically invokes
subscribe(Set, EventHandler), using theEventHandlingComponent.supportedEvents()as the set of compatiblenamesthe component in question can deal with.- Parameters:
handlingComponent- The event handling component instance to subscribe with this registry.- Returns:
- This registry for fluent interfacing.
-