Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.util
Class ListenerBroadcast

    java.lang.Object
      org.gradle.util.ListenerBroadcast

    class ListenerBroadcast
    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.

param:
  The listener type.

Nested Class Summary
`class` | `ListenerBroadcast.BroadcastInvocationHandler`
`class` | `ListenerBroadcast.ClosureInvocationHandler`
`class` | `ListenerBroadcast.ListenerInvocationHandler`

Constructor Summary
`ListenerBroadcast(java.lang.Class type)`

Method Summary
`void` | `add(T listener)` Adds a listener.
`void` | `add(java.lang.String methodName, Closure closure)` Adds a closure to be notified when the given method is called.
`T` | `getSource()` Returns the broadcaster.
`void` | `remove(T listener)`

Methods inherited from class java.lang.Object
hashCode, getClass, equals, toString, wait, wait, wait, notify, notifyAll

Constructor Detail

### ListenerBroadcast

    public ListenerBroadcast(java.lang.Class type)

Method Detail

### add

    public void add(T listener)

  Adds a listener.
  param:
    listener The listener.

### add

    public void add(java.lang.String methodName, Closure closure)

  Adds a closure to be notified when the given method is called.

### getSource

    public T getSource()

  Returns the broadcaster. Any method call on this object is broadcast to all listeners.
  return:
    The broadcaster.

### remove

    public void remove(T listener)

Groovy Documentation