Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356557

Summary: Compatibility Layer - Getting services via getViewSite().getServices()
Product: [Eclipse Project] Platform Reporter: Lars Vogel <Lars.Vogel>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED INVALID QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3 CC: Lars.Vogel, pwebster, remy.suen, tom.schindl
Version: 4.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Lars Vogel CLA 2011-09-02 04:29:06 EDT
I tried using getViewSite().getServices(MyService) for a View in the compatibility layer and hoped to get my own defined service. 

I checked in the console and saw that my service was registered. Is this supposed to work?
Comment 1 Remy Suen CLA 2011-09-02 06:26:48 EDT
(In reply to comment #0)
> I tried using getViewSite().getServices(MyService) for a View in the
> compatibility layer and hoped to get my own defined service.

How did you define this service? Is this an OSGi service or are you using a service factory of Eclipse?
Comment 2 Lars Vogel CLA 2011-10-11 15:45:48 EDT
@Remy: I registered it as OSGi service. My assumption was that this would be one of the enhancements of e4 for "old" RCP applications.
Comment 3 Remy Suen CLA 2011-10-11 16:11:50 EDT
(In reply to comment #2)
> @Remy: I registered it as OSGi service.

If it's an OSGi service then this should certainly work, I'll take a look. Thanks for the info, Lars.
Comment 4 Remy Suen CLA 2011-10-12 08:01:58 EDT
(In reply to comment #2)
> @Remy: I registered it as OSGi service.

Lars, was it a service registered through code or a DS?
Comment 5 Remy Suen CLA 2011-10-12 10:55:00 EDT
I declared a DS and my view's getSite().getService(*) method was able to return the object.
Comment 6 Lars Vogel CLA 2011-10-14 16:40:25 EDT
Thanks Remy. I will re-test and post the results.
Comment 7 Lars Vogel CLA 2012-05-10 13:57:19 EDT
Retested. Works. For for the long delay in testing.