[shrinkwrap-issues] [JBoss JIRA] Commented: (SHRINKWRAP-242) Get shrinkwrap to work from inside and OSGi framework

David Bosschaert (JIRA) jira-events at lists.jboss.org
Mon Nov 22 07:30:54 EST 2010


    [ https://jira.jboss.org/browse/SHRINKWRAP-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12564536#comment-12564536 ] 

David Bosschaert commented on SHRINKWRAP-242:
---------------------------------------------

I have a first phase of this implemented. You can find it in the shrinkwrap_osgi branch of my fork: https://github.com/bosschaert/shrinkwrap/tree/shrinkwrap_osgi

Changes involved are:
* Made shrinkwrap-api.jar, shrinkwrap-spi.jar and shrinkwrap-impl-base.jar OSGi bundles by adding OSGi metadata to the MANIFEST.MF. These jars are also still ordinary jars so they can be used both in an OSGi framework as well as outside of OSGi as plain jars. The OSGi metadata is added with the maven-bundle-plugin.
* Created a Service API for ShrinkWrap (ShrinkWrapService) and created an implementation of it for OSGi which gets registered through the Bundle Activator in the shrinkwrap-impl-base.jar. OSGi bundles access ShrinkWrap via the Service Registry.
* Tested in JBoss OSGi, Felix, Equinox. 
* I moved 2 classes (UnknownExtensionTypeExceptionDelegator and IOUtilDelegator) from the impl-base module to the API module, since they were causing split packages across API and Impl-Base (the org.jboss.shrinkwrap.api and org.jboss.shrinkwrap.api.asset packages belong in the API bundle).
* Added tests.

I did find an issue when running it in AS7 in that when addClass(SomeClass.class) or addClass("org.acme.MyClass", myclassloader) was used that somewhere down the line the ThreadContextClassLoader gets used instead of the classloader passed in to this API, but I think this is a separate issue, I've created SHRINKWRAP-244 for that.

> Get shrinkwrap to work from inside and OSGi framework
> -----------------------------------------------------
>
>                 Key: SHRINKWRAP-242
>                 URL: https://jira.jboss.org/browse/SHRINKWRAP-242
>             Project: ShrinkWrap
>          Issue Type: Task
>    Affects Versions: 1.0.0-alpha-11
>            Reporter: David Bosschaert
>            Assignee: David Bosschaert
>
> Currently there are issues around the use of Shrinkwrap in an OSGi framework. The libraries don't contain the necessary Manifest headers and just adding them causes classloading problems as the TCCL is used during the boot process.
> Shrinkwrap should be usable from within OSGi.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the shrinkwrap-issues mailing list