Hi,

There's a pb with the current implementation:
When we get the Observation manager implementation and list the  
registered listeners we only get the components that have been  
initialized *before* we get the Observation manager component. Thus if  
we want to be sure all listeners will receive events we need to ensure  
they're loaded first. This is hard to do.

I'm proposing instead to modify the observation module:

* Modify EventListener to be a @ComponentRole
* Add List<Event> EventListener.getEvents() (the events that the  
listener handles)
* Inject List<EventListener> in DefaultObservationManager. Thus when  
the Observation Manager is looked up, all listener components are  
created and injected.
* Keep add/removeListener in ObservationManager so that listeners can  
be manually added/removed (for ex if a new listener component is added  
dynamically in the system) but with following signatures:
- addListener(EventListener);
- removeListener(EventListener);

WDYT?

Thanks
-Vincent

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to