chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sascha Homeier (JIRA)" <>
Subject [jira] [Commented] (CMIS-878) Allow loading classes from other OSGi Bundles in OSGi Client Wrapper
Date Mon, 01 Jun 2015 12:52:17 GMT


Sascha Homeier commented on CMIS-878:

I noticed some good improvements. Fo example the null checks applied to the return values
of bundle.adapt() or bundleWiring.getClassLoader().
Due to the OSGi Spec  ([Bundle|]
and [BundleWiring|])
these values really can be null (though if not the impl is hardened against weak OSGi spec

I am still testing but I noticed sth. which causes me headaches:
The OpenCMIS OSGi Client Wrapper is compiled versus OSGi Spec 5. As Wiring is specified since
OSGi Spec 4.3 that is why we have no problems to compile the Wrapper with this new adjustements.
But I can see no version range in the Manifest "Import-Package"-Header of the OpenCMIS OSGi
Client Wrapper for package _org.osgi.framework_. So in general I think the Wrapper up to v0.13.0
should also work inside OSGi frameworks/container < 4.3 (cause the version range is not
specified and no 4.3 capabilities are used until imho there are no constraints against

When we now introduce this enhancement we add the following package to the Import-Package
Header: _org.osgi.framework.wiring_
So this would mean if this enhancement is released then the next version will cause an "Missing
constraint" BundleException in OSGi container < 4.3.

How are your thoughts on this?

OSGi Core Spec 4.3 was released in [April 2011|].

> Allow loading classes from other OSGi Bundles in OSGi Client Wrapper
> --------------------------------------------------------------------
>                 Key: CMIS-878
>                 URL:
>             Project: Chemistry
>          Issue Type: Improvement
>          Components: opencmis-client
>    Affects Versions: OpenCMIS 0.12.0
>         Environment: OSGi
>            Reporter: Sascha Homeier
>            Assignee: Florian Müller
>            Priority: Minor
> When using the OpenCMIS OSGi Client Wrapper it is hard to load classes from other bundles.
For example if you specify an own Authentication Provider class as Session Parameter then
the Wrapper will not find this class when it is located inside another bundle. Same problem
should occur when defining an own Cache.
> *1)*
> It would be nice if other bundles could register their Classloaders so that ClassLoaderUtil
can use it when trying to load classes.
> *2)*
> Another simpler option would be to simply add "DynamicImport-Package: *" to the Manifest
of the Wrapper. By doing this the Wrapper will find all classes which are exported by other
bundles. Though this approach feels more like a hack since it breaks modularity.
> What do you think about it?
> Cheers
> Sascha

This message was sent by Atlassian JIRA

View raw message