public abstract class AbstractConcurrentEventManager extends Object implements EventManager, Serializable
Modifier and Type | Field and Description |
---|---|
protected Collection |
_listeners |
Constructor and Description |
---|
AbstractConcurrentEventManager()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(Object listener)
Register an event listener.
|
Exception[] |
fireEvent(Object event)
Fire the given event to all listeners.
|
protected abstract void |
fireEvent(Object event,
Object listener)
Implement this method to fire the given event to the given listener.
|
Collection |
getListeners()
Return a read-only list of listeners.
|
boolean |
hasListener(Object listener)
Return whether the given instance is in the list of listeners.
|
boolean |
hasListeners()
Return true if there are any registered listeners.
|
boolean |
isFailFast()
Whether to fail after the first exception thrown by any listener.
|
protected Collection |
newListenerCollection()
Return a new concurrent container for listeners.
|
boolean |
removeListener(Object listener)
Remove an event listener.
|
void |
setFailFast(boolean failFast)
Whether to fail after the first exception thrown by any listener.
|
protected final Collection _listeners
public AbstractConcurrentEventManager()
public boolean isFailFast()
public void setFailFast(boolean failFast)
public void addListener(Object listener)
addListener
in interface EventManager
public boolean removeListener(Object listener)
removeListener
in interface EventManager
public boolean hasListener(Object listener)
hasListener
in interface EventManager
public boolean hasListeners()
hasListeners
in interface EventManager
public Collection getListeners()
getListeners
in interface EventManager
public Exception[] fireEvent(Object event)
fireEvent
in interface EventManager
protected abstract void fireEvent(Object event, Object listener) throws Exception
Exception
protected Collection newListenerCollection()
CopyOnWriteArrayList
by default.Copyright © 2006–2019 Apache Software Foundation. All rights reserved.