Package org.eclipse.jgit.events
Class ListenerList
- java.lang.Object
-
- org.eclipse.jgit.events.ListenerList
-
public class ListenerList extends Object
Manages a thread-safe list ofRepositoryListener
s.
-
-
Constructor Summary
Constructors Constructor Description ListenerList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListenerHandle
addConfigChangedListener(ConfigChangedListener listener)
Register a ConfigChangedListener.ListenerHandle
addIndexChangedListener(IndexChangedListener listener)
Register an IndexChangedListener.<T extends RepositoryListener>
ListenerHandleaddListener(Class<T> type, T listener)
Add a listener to the list.ListenerHandle
addRefsChangedListener(RefsChangedListener listener)
Register a RefsChangedListener.ListenerHandle
addWorkingTreeModifiedListener(WorkingTreeModifiedListener listener)
Register aWorkingTreeModifiedListener
.void
dispatch(RepositoryEvent event)
Dispatch an event to all interested listeners.
-
-
-
Method Detail
-
addWorkingTreeModifiedListener
public ListenerHandle addWorkingTreeModifiedListener(WorkingTreeModifiedListener listener)
Register aWorkingTreeModifiedListener
.- Parameters:
listener
- the listener implementation.- Returns:
- handle to later remove the listener.
- Since:
- 4.9
-
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.- 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.
-
-