org.apache.hivemind.service.impl
Class ThreadEventNotifierImpl

java.lang.Object
  extended by org.apache.hivemind.service.impl.ThreadEventNotifierImpl
All Implemented Interfaces:
ThreadEventNotifier

public class ThreadEventNotifierImpl
extends java.lang.Object
implements ThreadEventNotifier

Implementation of ThreadEventNotifier, available as service hivemind.ThreadEventNotifier.

Author:
Howard Lewis Ship

Constructor Summary
ThreadEventNotifierImpl()
           
ThreadEventNotifierImpl(org.apache.commons.logging.Log log)
           
 
Method Summary
 void addThreadCleanupListener(ThreadCleanupListener listener)
          Adds the listener.
 void fireThreadCleanup()
          Invokes ThreadCleanupListener.threadDidCleanup() on all listeners, and discards the list of listeners.
 void removeThreadCleanupListener(ThreadCleanupListener listener)
          Removes the listener, if it has been previously added.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadEventNotifierImpl

public ThreadEventNotifierImpl()

ThreadEventNotifierImpl

public ThreadEventNotifierImpl(org.apache.commons.logging.Log log)
Method Detail

addThreadCleanupListener

public void addThreadCleanupListener(ThreadCleanupListener listener)
Description copied from interface: ThreadEventNotifier
Adds the listener. The notifier retains the listener until ThreadEventNotifier.fireThreadCleanup() is invoked, at which point is discarded.

Specified by:
addThreadCleanupListener in interface ThreadEventNotifier

removeThreadCleanupListener

public void removeThreadCleanupListener(ThreadCleanupListener listener)
Description copied from interface: ThreadEventNotifier
Removes the listener, if it has been previously added. If the listener has been added multiple times, only one instance is removed. Note that this method is rarely used, because all listeners are automatically removed by ThreadEventNotifier.fireThreadCleanup().

Specified by:
removeThreadCleanupListener in interface ThreadEventNotifier

fireThreadCleanup

public void fireThreadCleanup()
Description copied from interface: ThreadEventNotifier
Invokes ThreadCleanupListener.threadDidCleanup() on all listeners, and discards the list of listeners.

Specified by:
fireThreadCleanup in interface ThreadEventNotifier