On 12/06/2009, at 10:59 AM, Dmitry Skavish wrote:
yes of course I can do it this way. I was just curious if there is a
"better", more structured way in DS or OSGi itself. something
similar to
those extension points, like specifying a "target" for my services
I think you should take a look at the "target" filtering mechanism in
DS (I believe this is what Richard was referring to). It lets you
filter based on service properties in your component definition. IIRC,
if you were to a define a component reference that behaved like an
extension point you might do something like this:
<component ....>
<reference id="ref1" interface="org.something.else.MyInterface"
target="(&(extensionpoint=org.something.else.featurepoint1))"/>
</component>
In this way, your component would be "wired" to the service that has
the "extensionpoint" property equal to
"org.something.else.featurepoint1". Of course, the property name I
chose here is completely arbitrary, you can use whatever you like. You
could also filter on service.pid properties I guess, which are
supposed to be unique.
The added advantage of that method is that if you use Config Admin to
configure your DS components, you can make the "target" filter
property specified above configurable in the CM configuration.
Cheers
Chris
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]