public interface Listenable
Modifier and Type | Method and Description |
---|---|
default void |
addListener(Object listener)
Adds a listener to the component.
|
CompletionStage<Void> |
addListenerAsync(Object listener)
Asynchronous version of
addListener(Object) |
Set<Object> |
getListeners()
Deprecated.
Since 10.0, with no replacement
|
default void |
removeListener(Object listener)
Removes a listener from the component.
|
CompletionStage<Void> |
removeListenerAsync(Object listener)
Asynchronous version of
removeListener(Object) |
default void addListener(Object listener)
Listener
and
further to that, contain methods annotated appropriately, otherwise the listener will not be registered.
See the Listener
annotation for more information.
listener
- listener to add, must not be nullCompletionStage<Void> addListenerAsync(Object listener)
addListener(Object)
listener
- listener to add, must not be nulldefault void removeListener(Object listener)
listener
- listener to remove. Must not be null.IllegalLifecycleStateException
- may be thrown if the Listenable
is stopped.CompletionStage<Void> removeListenerAsync(Object listener)
removeListener(Object)
listener
- listener to remove, must not be null@Deprecated Set<Object> getListeners()
Copyright © 2021 JBoss by Red Hat. All rights reserved.