org.eclipse.jgit.events

## Class ListenerList

- java.lang.Object
- - org.eclipse.jgit.events.ListenerList

    public class ListenerList
    extends Object

Manages a thread-safe list of `RepositoryListener`s.

### Constructor Summary

Constructors
Constructor and Description
`ListenerList()`

### Method Summary

Methods
`ListenerHandle` `addConfigChangedListener(ConfigChangedListener listener)` Register a ConfigChangedListener.
`ListenerHandle` `addIndexChangedListener(IndexChangedListener listener)` Register an IndexChangedListener.
`<T extends RepositoryListener> ListenerHandle` `addListener(Class<T> type, T listener)` Add a listener to the list.
`ListenerHandle` `addRefsChangedListener(RefsChangedListener listener)` Register a RefsChangedListener.
`void` `dispatch(RepositoryEvent event)` Dispatch an event to all interested listeners.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ListenerList

    public ListenerList()

### Method Detail

#### addIndexChangedListener

    public ListenerHandle addIndexChangedListener(IndexChangedListener listener)

Register an IndexChangedListener.

Parameters:
  `listener` - the listener implementation.
Returns:
  handle to later remove the listener.

#### addRefsChangedListener

    public ListenerHandle addRefsChangedListener(RefsChangedListener listener)

Register a RefsChangedListener.

Parameters:
  `listener` - the listener implementation.
Returns:
  handle to later remove the listener.

#### addConfigChangedListener

    public ListenerHandle addConfigChangedListener(ConfigChangedListener listener)

Register a ConfigChangedListener.

Parameters:
  `listener` - the listener implementation.
Returns:
  handle to later remove the listener.

#### addListener

    public <T extends RepositoryListener> ListenerHandle addListener(Class<T> type,
                                                            T listener)

Add a listener to the list.

Type Parameters:
  `T` - the type of listener being registered.
Parameters:
  `type` - type of listener being registered.
  `listener` - the listener instance.
Returns:
  a handle to later remove the registration, if desired.

#### dispatch

    public void dispatch(RepositoryEvent event)

Dispatch an event to all interested listeners.

Listeners are selected by the type of listener the event delivers to.

Parameters:
  `event` - the event to deliver.