Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353788 - Registering a service that produces events is a pain
Summary: Registering a service that produces events is a pain
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.0 M2   Edit
Assignee: Simon Kaegi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-03 11:37 EDT by Simon Kaegi CLA
Modified: 2012-09-25 17:11 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Kaegi CLA 2011-08-03 11:37:55 EDT
Looking at how we're registering in-page services we're doing stuff like:

new mFavorites.Favorites({parent: "favoriteProgress", serviceRegistry: serviceRegistry});

we instead should be doing:

serviceRegistry.register(new mFavorites.Favorites({parent: "favoriteProgress"});

--

The problem I think is that tying into the event api is a real pain. In particular you don't get access to the registrations eventTarget until after the service is registered. We need to make this easier by maybe using registering/unregistering calls on the service implementation to pass it what it needs or something similar.
Comment 1 Simon Kaegi CLA 2012-09-25 17:11:06 EDT
The ServiceRegistration shenanigans are no more.

If your service supports event you should use orion/EventTarget internally and expose addEventListener, and removeEventListener. The ServiceRegistry no longer does this for you automagically although it will handle the communication aspects if you plugin registers a service that exposes addEventListener and removeEventListener.