Package 

Interface IEventNotifier


  • 
    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 Unit subscribe(THandler handler) Subscribe to listen for events.
      abstract Unit unsubscribe(THandler handler) Unsubscribe to no longer listen for events.
      abstract Boolean getHasSubscribers() Whether there are currently any subscribers.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.