Hi Martin,
OSGi-JAXB integration that I've done with a test application is available
here <
http://www.dynamicjava.org/projects/jsr-api/jaxb-osgi>, modifications
were done only to the JAXB API jar. In short:
1. OSGi Headers were added to the manifest.
2. OSGi-Aware class/resource loader was used to locate the Factory for
JAXB SPI (Service Provider Interfaces) and load needed implementation
classes.
3. If no class loader was provided to the JAXBContext.createInstance(...)
method the OSGi aware class loader will be used. Although it's better to
pass entity classes Class Loader since this is the only way to guarantee
that no package wiring conflicts would occur if different versions of the
same entity classes are available, but in cases where it's not up to the
user (like 3rd components, e.g., JAX-WS) there is no guarantee that the
JAXBContext.createInstance(...) which takes a class loader as a parameter
will be invoked, for such cases the approach with the default OSGi-Aware
class loader was used.
It's important to note that I developed the solution taking into account
that the only part that I allowed myself to modify was the JAXB API jar, not
the implementation class libraries, but in your place I would add a Bundle
Activator to the JAXB Implementation bundle where I would register the
implementation of SPI as OSGi Services then consume them as OSGi Services in
the API bundle (this will prove more efficient for many reasons). Anyway, I
can help with the JAXB-OSGi migration/integration efforts too.
Best Regards,
Valery
On Tue, Jan 6, 2009 at 1:20 PM, Martin Grebac <Martin.Grebac_at_sun.com> wrote:
> Valery Abu-Eid wrote:
>
>> So far I've migrated/integrated with OSGi more than 10 open source
>> projects some of them are JSR APIs like JAXB, StAX
>>
> Hi,
> I'm interested to know more about the JAXB OSGi-fication. Only the apis
> were involved? Is it accessible somewhere as an open-source?
>
> Thanks,
> Martin Grebac
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jax-ws.dev.java.net
> For additional commands, e-mail: dev-help_at_jax-ws.dev.java.net
>
>