Interface Listenable

    • Method Detail

      • addListener

        default void addListener​(java.lang.Object listener)
        Adds a listener to the component. Typically, listeners would need to be annotated with Listener and further to that, contain methods annotated appropriately, otherwise the listener will not be registered.

        See the Listener annotation for more information.

        Parameters:
        listener - listener to add, must not be null
      • addListenerAsync

        java.util.concurrent.CompletionStage<java.lang.Void> addListenerAsync​(java.lang.Object listener)
        Asynchronous version of addListener(Object)
        Parameters:
        listener - listener to add, must not be null
        Returns:
        CompletionStage that when complete the listener is fully installed
      • removeListener

        default void removeListener​(java.lang.Object listener)
        Removes a listener from the component.
        Parameters:
        listener - listener to remove. Must not be null.
        Throws:
        IllegalLifecycleStateException - may be thrown if the Listenable is stopped.
      • removeListenerAsync

        java.util.concurrent.CompletionStage<java.lang.Void> removeListenerAsync​(java.lang.Object listener)
        Asynchronous version of removeListener(Object)
        Parameters:
        listener - listener to remove, must not be null
        Returns:
        CompletionStage that when complete the listener is fully removed
      • getListeners

        @Deprecated
        java.util.Set<java.lang.Object> getListeners()
        Deprecated.
        Since 10.0, with no replacement
        Returns:
        a set of all listeners registered on this component.