-
public interface IEventNotifier<THandler extends Object>A generic interface which indicates the implementer has the ability to notify events through the generic THandler interface specified. When implemented, any outside component may subscribe to the events being notified. When an event is to be raised, the implementor will call a method within THandler, the method(s) defined therein are entirely dependent on the implementor/definition.
Unlike ICallbackNotifier, there can be one zero or more event subscribers at any given time.
-
-
Method Summary
Modifier and Type Method Description abstract Unitsubscribe(THandler handler)Subscribe to listen for events. abstract Unitunsubscribe(THandler handler)Unsubscribe to no longer listen for events. abstract BooleangetHasSubscribers()Whether there are currently any subscribers. -
-
Method Detail
-
subscribe
abstract Unit subscribe(THandler handler)
Subscribe to listen for events.
- Parameters:
handler- The handler that will be called when the event(s) occur.
-
unsubscribe
abstract Unit unsubscribe(THandler handler)
Unsubscribe to no longer listen for events.
- Parameters:
handler- The handler that was previous registered via subscribe.
-
getHasSubscribers
abstract Boolean getHasSubscribers()
Whether there are currently any subscribers.
-
-
-
-