A parameter where?

As was mentioned the order of <reference> elements in the <component> 
element is relevant. I suppose the order of @Reference annotations in a 
source file could also be relevant but that assumes that the order is 
somehow reflected in a resulting class file and I am not sure that is the 
case.

In general it is best to never rely upon ordering. Your component is being 
injected with objects and you need to handle any ordering. For you log 
example, you could have a log method which called the injected log object. 
But if the log object has not been injected, it could buffer the log 
information and then, when the log object is injected, dump the buffer to 
the log object.
-- 

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
[email protected]

office: +1 386 848 1781
mobile: +1 386 848 3788




From:   "Ewgenij Sokolovski" <[email protected]>
To:     "OSGi Developer Mail List" <[email protected]>
Date:   2013/10/29 11:51
Subject:        Re: [osgi-dev] Defining binding order for servises with DS
Sent by:        [email protected]



OK, thanks for the information! Would it not be a good idea to introduce 
an additional parameter for the order of binding? Then the developer could 
easily define how his services are bound with BND or without BND...
 
BR
Ewgenij
 
Gesendet: Dienstag, 29. Oktober 2013 um 14:19 Uhr
Von: "BJ Hargrave" <[email protected]>
An: "OSGi Developer Mail List" <[email protected]>
Betreff: Re: [osgi-dev] Defining binding order for servises with DS
However, if you are using DS annotations rather than writing the XML file 
yourself, then you have no controls over the order of reference elements 
bnd will write to the generated XML file.
-- 
 

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
[email protected]

office: +1 386 848 1781
mobile: +1 386 848 3788
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to