Github user ahgittin commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/90#discussion_r15418622
--- Diff: core/src/main/java/brooklyn/management/ha/OsgiManager.java ---
@@ -108,11 +108,22 @@ public void registerBundle(String bundleUrl) {
if (bundleNameVersion==null) {
bundleNameVersion = bundleUrlOrNameVersionString;
}
-
+
Maybe<Bundle> bundle = Osgis.getBundle(framework,
bundleNameVersion);
if (bundle.isPresent()) {
- @SuppressWarnings("unchecked")
- Class<T> clazz = (Class<T>)
bundle.get().loadClass(type);
+ Bundle b = bundle.get();
+ Class<T> clazz;
+ //Extension bundles don't support loadClass.
+ //Instead load from the app classpath.
+ if (Osgis.isExtensionBundle(b)) {
+ @SuppressWarnings("unchecked")
+ Class<T> c = (Class<T>)Class.forName(type);
--- End diff --
this will totally ignore the extension, right? do we need to try to load
via the bundle being extended? or maybe, if extension bundles are installed,
attempt a second pass which tries again to load via the non-bundle extensions?
(my understanding is that, if i had `bundle-A` and
`extension-A1-for-bundle-A`, i'd have to install `bundle-A` first into the
OSGi container, but an attempt to `loadClass("ClassInExtensionA1")` on
`bundle-A` would fail until i've installed `extension-A1` -- but the code here
doesn't attempt to reload with `bundle-A` after installing `extension-A1`.
please correct me if i'm wrong!)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---