You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Shai Amar <sh...@krynnlance.com> on 2011/09/12 13:59:03 UTC

iPOJO and service ranking

Hi all

Currently, I've implemented 2 iPOJO modules that implements the same
Interface module.
The first one is *PrimaryImpl*, and the second one is *BackupImpl*.

 I also have a client module that uses these modules with the *
dynamic-priority* policy.

I know that if a higher ranked service appears it will replace any lower
ranking service already injected into the component.

The question is how do I set the service ranking?

If I'm declaring the service, I can add the service.ranking as a property.
But, since the iPOJO declares this service, how can I set the service
ranking of these modules?

-- 
Regards

Shai Amar

Technologies manager, Founder
Krynnlance
www.krynnlance.com
www.backapps.com

Re: iPOJO and service ranking

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

If you're using XML, you can either have:
<provides>
	<property name="service.ranking" value="12"/>
</provides>

Or just having the service ranking set in your instance declaration:
<instance component="...">
	<property name="service.ranking" value="12"/>
</instance>

Regards,

Clement

On 13.09.2011, at 12:00, Shai Amar wrote:

> Thanks.
> 
> I have looked into it (
> http://felix.apache.org/site/providing-osgi-services.html) and saw that I
> can add in the metadata.xml file properties to the <provides> label.
> 
> Regards
> Shai Amar
> 
> 
> On Mon, Sep 12, 2011 at 6:39 PM, Richard Hall <he...@ungoverned.org> wrote:
> 
>> On Mon, Sep 12, 2011 at 4:59 AM, Shai Amar <sh...@krynnlance.com>
>> wrote:
>> 
>>> Hi all
>>> 
>>> Currently, I've implemented 2 iPOJO modules that implements the same
>>> Interface module.
>>> The first one is *PrimaryImpl*, and the second one is *BackupImpl*.
>>> 
>>> I also have a client module that uses these modules with the *
>>> dynamic-priority* policy.
>>> 
>>> I know that if a higher ranked service appears it will replace any lower
>>> ranking service already injected into the component.
>>> 
>>> The question is how do I set the service ranking?
>>> 
>>> If I'm declaring the service, I can add the service.ranking as a
>> property.
>>> But, since the iPOJO declares this service, how can I set the service
>>> ranking of these modules?
>>> 
>> 
>> iPOJO still lets you set service properties. If you are using XML or
>> annotations, just look in the docs are you'll see that you can set service
>> properties in either approach.
>> 
>> -> richard
>> 
>> 
>>> 
>>> --
>>> Regards
>>> 
>>> Shai Amar
>>> 
>>> Technologies manager, Founder
>>> Krynnlance
>>> www.krynnlance.com
>>> www.backapps.com
>>> 
>> 
> 
> 
> 
> -- 
> Regards
> 
> Shai Amar
> 
> Technologies manager, Founder
> Krynnlance
> www.krynnlance.com
> www.backapps.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: iPOJO and service ranking

Posted by Shai Amar <sh...@krynnlance.com>.
Thanks.

I have looked into it (
http://felix.apache.org/site/providing-osgi-services.html) and saw that I
can add in the metadata.xml file properties to the <provides> label.

Regards
Shai Amar


On Mon, Sep 12, 2011 at 6:39 PM, Richard Hall <he...@ungoverned.org> wrote:

> On Mon, Sep 12, 2011 at 4:59 AM, Shai Amar <sh...@krynnlance.com>
> wrote:
>
> > Hi all
> >
> > Currently, I've implemented 2 iPOJO modules that implements the same
> > Interface module.
> > The first one is *PrimaryImpl*, and the second one is *BackupImpl*.
> >
> >  I also have a client module that uses these modules with the *
> > dynamic-priority* policy.
> >
> > I know that if a higher ranked service appears it will replace any lower
> > ranking service already injected into the component.
> >
> > The question is how do I set the service ranking?
> >
> > If I'm declaring the service, I can add the service.ranking as a
> property.
> > But, since the iPOJO declares this service, how can I set the service
> > ranking of these modules?
> >
>
> iPOJO still lets you set service properties. If you are using XML or
> annotations, just look in the docs are you'll see that you can set service
> properties in either approach.
>
> -> richard
>
>
> >
> > --
> > Regards
> >
> > Shai Amar
> >
> > Technologies manager, Founder
> > Krynnlance
> > www.krynnlance.com
> > www.backapps.com
> >
>



-- 
Regards

Shai Amar

Technologies manager, Founder
Krynnlance
www.krynnlance.com
www.backapps.com

Re: iPOJO and service ranking

Posted by Richard Hall <he...@ungoverned.org>.
On Mon, Sep 12, 2011 at 4:59 AM, Shai Amar <sh...@krynnlance.com> wrote:

> Hi all
>
> Currently, I've implemented 2 iPOJO modules that implements the same
> Interface module.
> The first one is *PrimaryImpl*, and the second one is *BackupImpl*.
>
>  I also have a client module that uses these modules with the *
> dynamic-priority* policy.
>
> I know that if a higher ranked service appears it will replace any lower
> ranking service already injected into the component.
>
> The question is how do I set the service ranking?
>
> If I'm declaring the service, I can add the service.ranking as a property.
> But, since the iPOJO declares this service, how can I set the service
> ranking of these modules?
>

iPOJO still lets you set service properties. If you are using XML or
annotations, just look in the docs are you'll see that you can set service
properties in either approach.

-> richard


>
> --
> Regards
>
> Shai Amar
>
> Technologies manager, Founder
> Krynnlance
> www.krynnlance.com
> www.backapps.com
>