org.apache.openjpa.lib.util.concurrent
public abstract class AbstractConcurrentEventManager extends java.lang.Object implements EventManager, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.util.Collection |
_listeners |
Constructor and Description |
---|
AbstractConcurrentEventManager()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(java.lang.Object listener)
Register an event listener.
|
java.lang.Exception[] |
fireEvent(java.lang.Object event)
Fire the given event to all listeners.
|
protected abstract void |
fireEvent(java.lang.Object event,
java.lang.Object listener)
Implement this method to fire the given event to the given listener.
|
java.util.Collection |
getListeners()
Return a read-only list of listeners.
|
boolean |
hasListener(java.lang.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 java.util.Collection |
newListenerCollection()
Return a new concurrent container for listeners.
|
boolean |
removeListener(java.lang.Object listener)
Remove an event listener.
|
void |
setFailFast(boolean failFast)
Whether to fail after the first exception thrown by any listener.
|
public AbstractConcurrentEventManager()
public boolean isFailFast()
public void setFailFast(boolean failFast)
public void addListener(java.lang.Object listener)
addListener
in interface EventManager
public boolean removeListener(java.lang.Object listener)
removeListener
in interface EventManager
public boolean hasListener(java.lang.Object listener)
hasListener
in interface EventManager
public boolean hasListeners()
hasListeners
in interface EventManager
public java.util.Collection getListeners()
getListeners
in interface EventManager
public java.lang.Exception[] fireEvent(java.lang.Object event)
fireEvent
in interface EventManager
protected abstract void fireEvent(java.lang.Object event, java.lang.Object listener) throws java.lang.Exception
java.lang.Exception
protected java.util.Collection newListenerCollection()
CopyOnWriteArrayList
by default.