0

In order to manage dynamic dependencies between OSGI services, the service binder bundle was introduced here. This service controls the availability of required services in the OSGI platform and establishes the bindings between services following their availability and a binding policy described in the bundle component descriptor. This customizes the bundle activation when the required services are not available. Is such service provided in Virgo or do we have to add and adapt the service binder in Virgo ?

Thanks.

Houcem Berrayana
  • 3,052
  • 22
  • 40
  • What's your reason for not using Blueprint to manage service dependencies? – Holly Cummins Mar 28 '12 at 16:20
  • When starting a Bundle, if Virgo can't find all dependencies the bundle could not be started. I want to customize that behavior so that service dependency resolution will not be always mandatory. I know that something like this exists on other OSGi implementations. – Houcem Berrayana Mar 28 '12 at 16:29
  • Would marking the services optional in blueprint metadata do the trick for you? Using blueprint allows you to take advantage of what's already in Virgo and Blueprint is a very robust way of managing service dependencies. – Holly Cummins Mar 28 '12 at 18:41

1 Answers1

1

The service binder is not provided with Virgo, but (as Holly suggests) there are some OSGi standard alternatives that satisfy the kinds of requirements you have. Two standards involve declaring services and service references in metadata in your bundles: Blueprint and Declarative Services. These are described in the OSGi specifications and various published books on OSGi.

OSGi Blueprint is implemented by the Gemini Blueprint component which is being included in Virgo 3.5.0 due to ship mid 2012. Earlier versions of Virgo included Spring DM 1.2.1 which is the technology which gave rise to the Blueprint standard. So on earlier versions, you can either use Spring DM directly -- its features are roughly a superset of those provided by Blueprint with slightly different, Spring-like syntax -- or you can add Gemini Blueprint to Virgo yourself (a web search should turn up the technique).

OSGi Declarative Services is (are?) another alternative and this was included in Virgo 3.0. Indeed service binder was the inspiration for Declarative Services.

glyn
  • 1,180
  • 8
  • 19