|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.lib.util.AbstractEventManager
public abstract class AbstractEventManager
Base event manager that handles adding/removing listeners and firing events. This class is reentrant-safe; listeners can be added and removed by other listeners when they receive events. The changes will not be visible until the event fire that initiated the recursive sequence of calls completes, however.
Constructor Summary | |
---|---|
AbstractEventManager()
|
Method Summary | |
---|---|
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. |
protected Collection |
newListenerCollection()
Return a new container for listeners. |
boolean |
removeListener(Object listener)
Remove an event listener. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractEventManager()
Method Detail |
---|
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |