TListener
- Listener typepublic abstract class AbstractListenerDispatcher<TListener>
extends java.lang.Object
implements java.lang.Iterable<TListener>
TListener
Constructor and Description |
---|
AbstractListenerDispatcher() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(TListener listener)
Adds the supplied listener to this dispatcher as a strongly referenced listener.
|
void |
addWeakListener(TListener listener)
Adds the supplied listener to this dispatcher as a weakly referenced listener.
|
boolean |
isShutdown() |
java.util.Iterator<TListener> |
iterator() |
protected abstract void |
logError(java.lang.String message,
java.lang.Throwable throwable) |
protected void |
notify(java.util.function.Consumer<TListener> notificationHandler,
java.lang.String notificationLogName) |
void |
removeAllListeners()
Removes all listeners from this dispatcher.
|
void |
removeListener(TListener listener)
Removes the supplied listener from this dispatcher (both weak and strong).
|
void |
shutdown()
Shuts down this dispatcher and removes all listeners.
|
public final void addListener(TListener listener)
A call to this method has no effect after shutdown()
has been called.
listener
- Listener objectpublic final void addWeakListener(TListener listener)
A call to this method has no effect after shutdown()
has been called.
Attempts to add a listener that is already strongly referenced will be ignored.
listener
- Listener objectpublic final void removeListener(TListener listener)
listener
- Listener objectprotected final void notify(java.util.function.Consumer<TListener> notificationHandler, java.lang.String notificationLogName)
protected abstract void logError(java.lang.String message, java.lang.Throwable throwable)
public final void removeAllListeners()
public final void shutdown()
After shutdown calls to addListener(Object)
are ignored.
public final boolean isShutdown()
true
when this dispatcher has been shut down.Copyright © 2001-2024 Jaybird (Firebird JDBC) team. All rights reserved.