|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@ComponentRole public interface ObservationManager
The main orchestrator for event notification. To receive events create a component implementing the
EventListener interface. Your component will be automatically registered when this Observation
Manager component is loaded. To send events to all registered listeners, call one of the
notify(org.xwiki.observation.event.Event, java.lang.Object, java.lang.Object) methods.
| Method Summary | |
|---|---|
void |
addEvent(String listenerName,
Event event)
Adds an Event to an already registered listener. |
void |
addListener(EventListener eventListener)
Manually add a listener. |
EventListener |
getListener(String listenerName)
|
void |
notify(Event event,
Object source)
Convenience front-end where the additional data parameter is null. |
void |
notify(Event event,
Object source,
Object data)
Call the registered listeners matching the passed Event. |
void |
removeEvent(String listenerName,
Event event)
Removes an Event to an already registered listener. |
void |
removeListener(String listenerName)
Remove a listener from the list of registered listeners. |
| Method Detail |
|---|
void addListener(EventListener eventListener)
EventListener interfaces are only loaded
when the Observation Manager component is created. Thus if you need to add a new listener while the
system is running you'll need to call this method.
Also note that contrary to other components it's not possible for the Observation Manager to watch
Component Manager events since the Component Manager is itself using the Observation Manager to send
its events (chicken and egg problem). Thus if any new Event Listener is created dynamically it needs to
be added using this method manually.
eventListener - the listener to registervoid removeListener(String listenerName)
listenerName - the name of the listener to remove (must match EventListener.getName()
void addEvent(String listenerName,
Event event)
listenerName - the name of the listener to which the event must be added
(must match EventListener.getName()event - the event to add to the matching listener
void removeEvent(String listenerName,
Event event)
listenerName - the name of the listener to which the event must be removed
(must match EventListener.getName()event - the event to remove to the matching listenerEventListener getListener(String listenerName)
listenerName - the name of the listener
void notify(Event event,
Object source,
Object data)
event - the event to pass to the registered listenerssource - the source of the event (or null)data - the additional data related to the event (or null)
void notify(Event event,
Object source)
null.
event - the event to pass to the registered listenerssource - the source of the event (or null)notify(org.xwiki.observation.event.Event, Object, Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||