org.jboss.threads
Class SimpleShutdownListenable
java.lang.Object
org.jboss.threads.SimpleShutdownListenable
- All Implemented Interfaces:
- ShutdownListenable
public final class SimpleShutdownListenable
- extends Object
- implements ShutdownListenable
A simple shutdown-listenable registry.
- Author:
- David M. Lloyd
Method Summary |
|
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleShutdownListenable
public SimpleShutdownListenable()
addShutdownListener
public <A> void addShutdownListener(EventListener<A> shutdownListener,
A attachment)
- Add a shutdown listener. If the target object is already shut down, the listener is invoked directly.
- Specified by:
addShutdownListener
in interface ShutdownListenable
- Type Parameters:
A
- the attachment type- Parameters:
shutdownListener
- the listenerattachment
- the attachment value to pass to the listener
shutdown
public void shutdown()
- Run and remove all registered listeners, and mark this object as having been shut down so that
future listeners are invoked immediately.
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.