felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clement Escoffier" <clement.escoff...@gmail.com>
Subject RE: Import-Service manifest header in bundle repository dependency resolver
Date Tue, 27 May 2008 13:52:47 GMT
No, the behavior is "normal" :-)

The event admin bundle uses import and export service headers. So, when the bundle is described
in the obr, the description contains the requirement on the services. But these requirements
should be optional. However the import-service can't describe an optional requirement.

To fix it, remove the import-service header (in the pom file) and then add an obr.xml file
in the src/main/resources folder with the following content:
<obr>
	<require extend="false" filter="(service=org.osgi.service.event.EventHandler)" multiple="true"
name="service" optional="true">Import Service org.osgi.service.event.EventHandler</require>
	<require extend="false" filter="(service=org.osgi.service.log.LogService)" multiple="false"
name="service" optional="true">Import Service org.osgi.service.log.LogService</require>
	<require extend="false" filter="(service=org.osgi.service.log.LogReaderService)" multiple="false"
name="service" optional="true">Import Service org.osgi.service.log.LogReaderService</require>
</obr>

Then re-deploy or re-install your bundle. The description will be updated and service requirements
will be optional.

Clement

> -----Message d'origine-----
> De : Pedro Pedruzzi [mailto:ppedruzzi@v2com.mobi]
> Envoyé : mardi 27 mai 2008 09:30
> À : dev@felix.apache.org
> Objet : Import-Service manifest header in bundle repository dependency
> resolver
> 
> Hi all!
> 
> I've noticed that the deprecated manifest header Import-Service is
> been considered by Felix impl. of RepositoryAdmin service while
> resolving dependencies.
> 
> My use case is simply:
> 
> obr deploy 'Apache Felix EventAdmin'
> 
> I get:
> Unsatisfied requirement(s):
> ---------------------------
>    (service=org.osgi.service.event.EventHandler)
>       Apache Felix EventAdmin
>    (service=org.osgi.service.log.LogService)
>       Apache Felix EventAdmin
>    (service=org.osgi.service.log.LogReaderService)
>       Apache Felix EventAdmin
> 
> The EventHandler interface is to be implemented by bundles whishing to
> listen for events.
> 
> Note: I have an active bundle implementing the LogService and
> LogReaderService services.
> 
> 
> Am I doing something wrong?
> 
> --
> Pedro Pedruzzi | Engenharia de Software | V2COM | +55 11 3094-3939


Mime
View raw message