jetbrains.buildServer.util
Class EventDispatcher<T extends java.util.EventListener>

java.lang.Object
  extended by jetbrains.buildServer.util.EventDispatcher<T>

public class EventDispatcher<T extends java.util.EventListener>
extends java.lang.Object

Author:
Eugene Zhuravlev Date: Nov 2, 2005

Nested Class Summary
static interface EventDispatcher.ErrorHandler
           
 
Field Summary
static EventDispatcher.ErrorHandler DEFAULT_ERROR_HANDLER
           
 
Constructor Summary
protected EventDispatcher(java.lang.Class<T> listenerClass)
           
 
Method Summary
 void addListener(T listener)
           
 void clearErrorHandler()
           
static
<T extends java.util.EventListener>
EventDispatcher<T>
create(java.lang.Class<T> listenerClass)
          Only public interfaces are allowed!
protected  java.lang.Object dispatch(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
 void dispose()
           
 EventDispatcher.ErrorHandler getErrorHandler()
           
 java.util.List<T> getListeners()
           
 T getMulticaster()
           
 boolean hasListeners()
           
 void removeListener(T listener)
           
 void setErrorHandler(EventDispatcher.ErrorHandler errorHandler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ERROR_HANDLER

public static final EventDispatcher.ErrorHandler DEFAULT_ERROR_HANDLER
Constructor Detail

EventDispatcher

protected EventDispatcher(@NotNull
                          java.lang.Class<T> listenerClass)
Method Detail

create

public static <T extends java.util.EventListener> EventDispatcher<T> create(@NotNull
                                                                            java.lang.Class<T> listenerClass)
Only public interfaces are allowed!

Parameters:
listenerClass - Class object for interface of events to dispatch
Returns:
instance of EventDispatcher<>

getMulticaster

public T getMulticaster()

getErrorHandler

@Nullable
public EventDispatcher.ErrorHandler getErrorHandler()

setErrorHandler

public void setErrorHandler(@Nullable
                            EventDispatcher.ErrorHandler errorHandler)

clearErrorHandler

public void clearErrorHandler()

dispatch

protected java.lang.Object dispatch(java.lang.Object proxy,
                                    java.lang.reflect.Method method,
                                    java.lang.Object[] args)

addListener

public void addListener(T listener)

removeListener

public void removeListener(T listener)

getListeners

@NotNull
public java.util.List<T> getListeners()

hasListeners

public boolean hasListeners()

dispose

public void dispose()