>>>>> Steinar Bang <[email protected]>:

> I now have some success: I created a DS component that listens for the
> OSGi services created by Aries spyfly, from the Twelvemonkeys SPI
> services, and registers the injected services with the imageio
> ServiceRegistry. 
[snip!]
> But since the spifly docs say: "Additionally services found in 
> META-INF/services are registered in the OSGi Service Registry."
> I decided to try a DS component that injects all Twelvemonkeys SPI
> services as OSGi services and use them to register the service in the
> imageio service registry:
>  
> https://github.com/steinarb/twelvemonkeys-karaf-demo/blob/master/src/main/java/no/priv/bang/demos/frontendkarafdemo/ImageioSpiRegistration.java#L12

I would very much like some feedback/comments on this approach.

E.g. is this a misuse of @Component, since it doesn't expose a service,
it never really goes active, but just exists to capture ImageIO SPI
services in the OSGi registry, and pass the services on to the ImageIO
ServiceRegistry?

Is there some SPIfly way that would have worked without creating a
component? (I couldn't find any from looking at the Spifly source code)

And should the @Component have some different annotations or annotation
parameters than the ones I've used?

And what about unregistrations and SPI lifecycle managment? Can an
osgi.serviceloader capability be unloaded? And does that unloading mean
that it should be unregistered from the ImageIO ServiceRegistry?

Thanks!


- Steinar

Reply via email to