org.gradle.util
Class ListenerBroadcast<T>

java.lang.Object
  extended by org.gradle.util.ListenerBroadcast<T>
Type Parameters:
T - The listener type.

public class ListenerBroadcast<T>
extends java.lang.Object

Manages a set of listeners of type T. Provides an implementation of T which can be used to broadcast to all registered listeners.


Constructor Summary
ListenerBroadcast(java.lang.Class<T> type)
           
 
Method Summary
 void add(java.lang.String methodName, groovy.lang.Closure closure)
          Adds a closure to be notified when the given method is called.
 void add(T listener)
          Adds a listener.
 T getSource()
          Returns the broadcaster.
 void remove(T listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListenerBroadcast

public ListenerBroadcast(java.lang.Class<T> type)
Method Detail

getSource

public T getSource()
Returns the broadcaster. Any method call on this object is broadcast to all listeners.

Returns:
The broadcaster.

add

public void add(T listener)
Adds a listener.

Parameters:
listener - The listener.

add

public void add(java.lang.String methodName,
                groovy.lang.Closure closure)
Adds a closure to be notified when the given method is called.


remove

public void remove(T listener)