Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330865 - OSGi integration story, plan of action
Summary: OSGi integration story, plan of action
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: E4 (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-22 17:14 EST by Simon Chemouil CLA
Modified: 2013-07-17 04:47 EDT (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Chemouil CLA 2010-11-22 17:14:12 EST
This is a first follow-up to my mail about the OSGi integration story in E4. My goal is to improve the current integration following the best practices in OSGi and thus make E4 a first-class consumer of the OSGi framework. Ok, so those best practices aren't always easy to follow, and the users may not follow them perfectly, but as a framework I believe E4 should :).

I've been investigating the code, checking OSGi best practices, etc... to finally come up with a plan of action.  

Plan of action:
(1) Having a way to get the bundle context injected in user code (people should not be forced to call FrameworkUtil#getBundle() or have an activator with a static bundleContext reference)

(2) When getting services through injection, the service should be bound to the appropriate bundle's bundle context, so that the framework can unbind when that bundle is stopped. The whole "lifecycle" issue is probably linked to this one (ie, what to do with the UI/model contributed by a bundle as well).

(3) Allow service injection to work with dynamic services (i.e, even when services weren't there at first). 

(4) Improve the general OSGi integration by making some or all the "20 services" available as OSGi services as well (not just as an IContextFunction). Of course they should be tagged with unique properties so that they're not bound to be singletons.

(5) Finally, once we have a cleaner base, implement filters on properties for service injection, and a way to get a collection of services injected.



I'll open different bugs for each step, and we can discuss the general plan here. (I won't open all the bugs now).
Comment 1 Simon Chemouil CLA 2010-11-22 17:16:05 EST
I have open bug 330866 for:
(1) Having a way to get the bundle context injected in user code
Comment 2 Lars Vogel CLA 2013-07-17 04:47:55 EDT
I close this planning issue as fixed, as I think the integration is already working and we have Bug 330866. I suggest to open more specific bugs for missing OSGi integration features.