Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » [DS] Can someone point me to a service ranking example?
[DS] Can someone point me to a service ranking example? [message #129107] Tue, 14 April 2009 16:51 Go to next message
Susan F. McCourt is currently offline Susan F. McCourtFriend
Messages: 16
Registered: July 2009
Junior Member
Hi...
I'm trying to use a service ranking in an example that demonstrates how
a product reusing the p2 UI could contribute a service (configurable UI
policy) with a higher ranking than the one contributed by p2. I can't
seem to get it working, and couldn't find an example.

My service declaration looks like this:

<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
name=" org.eclipse.equinox.p2.examples.rcp.sdkbundlevisibility.poli cy ">
<implementation
class=" org.eclipse.equinox.p2.examples.rcp.sdkbundlevisibility.p2.A llIUsAreVisiblePolicy "/>
<service>
<provide
interface=" org.eclipse.equinox.internal.provisional.p2.ui.policy.Policy "/>
</service>
<property name="service.ranking" value="1000"/>
</scr:component>

However the p2 policy (no service ranking, so defaults to 0) is winning.
The service tracker is disregarding the property since it's read as a
string...so I must be doing something silly wrong.

susan
Re: [DS] Can someone point me to a service ranking example? [message #129189 is a reply to message #129107] Wed, 15 April 2009 20:19 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
Susan McCourt wrote:
> Hi...
> I'm trying to use a service ranking in an example that demonstrates how
> a product reusing the p2 UI could contribute a service (configurable UI
> policy) with a higher ranking than the one contributed by p2. I can't
> seem to get it working, and couldn't find an example.
>
> My service declaration looks like this:
>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
> name=" org.eclipse.equinox.p2.examples.rcp.sdkbundlevisibility.poli cy ">
> <implementation
> class=" org.eclipse.equinox.p2.examples.rcp.sdkbundlevisibility.p2.A llIUsAreVisiblePolicy "/>
>
> <service>
> <provide
> interface=" org.eclipse.equinox.internal.provisional.p2.ui.policy.Policy "/>
> </service>
> <property name="service.ranking" value="1000"/>
> </scr:component>
>
> However the p2 policy (no service ranking, so defaults to 0) is winning.
> The service tracker is disregarding the property since it's read as a
> string...so I must be doing something silly wrong.
>
> susan

Hi Susan,

You must specify the type for the service property when it is not a
String ...
<property name="service.ranking" type="Integer" value="1000"/>

See section 112.4.5 of the specification. Also the DS tooling in PDE
allows you to specify the type for the service properties.

HTH.
Tom
Previous Topic:Problem installing from (non-archive) update site with M6
Next Topic:Non-deterministic null return value from getBundleDescription()
Goto Forum:
  


Current Time: Thu Dec 26 12:20:44 GMT 2024

Powered by FUDForum. Page generated in 0.03615 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top