JBoss Threads 2.0.0.GA-redhat-2

org.jboss.threads
Class SimpleShutdownListenable

java.lang.Object
  extended by 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

Constructor Summary
SimpleShutdownListenable()
           
 
Method Summary
<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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleShutdownListenable

public SimpleShutdownListenable()
Method Detail

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 listener
attachment - 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.


JBoss Threads 2.0.0.GA-redhat-2

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.