public final class SimpleShutdownListenable extends java.lang.Object implements ShutdownListenable
| Modifier and Type | Class and Description |
|---|---|
private static class |
SimpleShutdownListenable.Registration<A> |
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<SimpleShutdownListenable.Registration<?>> |
list |
| Constructor and Description |
|---|
SimpleShutdownListenable() |
| Modifier and Type | Method and Description |
|---|---|
<A> void |
addShutdownListener(EventListener<A> shutdownListener,
A attachment)
Add a shutdown listener.
|
void |
shutdown()
Run and remove all registered listeners, and mark this object as having been shut down so that
future listeners are invoked immediately.
|
private java.util.List<SimpleShutdownListenable.Registration<?>> list
public <A> void addShutdownListener(EventListener<A> shutdownListener, A attachment)
addShutdownListener in interface ShutdownListenableA - the attachment typeshutdownListener - the listenerattachment - the attachment value to pass to the listenerpublic void shutdown()