Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/BaseData.java6
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/hooks/ClassLoadingHook.java8
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java7
3 files changed, 12 insertions, 9 deletions
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/BaseData.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/BaseData.java
index dc88151be..5cf202cc8 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/BaseData.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/BaseData.java
@@ -75,9 +75,7 @@ public class BaseData implements BundleData {
/**
* This method calls all the configured class loading hooks {@link ClassLoadingHook#createClassLoader(ClassLoader, ClassLoaderDelegate, BundleProtectionDomain, BaseData, String[])}
* methods until on returns a non-null value. If none of the class loading hooks returns a non-null value
- * then the default classloader implementation is used. <p>
- * After the classloader is created all configured class loading hooks
- * {@link ClassLoadingHook#initializedClassLoader(BaseClassLoader, BaseData)} methods are called.
+ * then the default classloader implementation is used.
* @see BundleData#createClassLoader(ClassLoaderDelegate, BundleProtectionDomain, String[])
*/
public BundleClassLoader createClassLoader(ClassLoaderDelegate delegate, BundleProtectionDomain domain, String[] bundleclasspath) {
@@ -88,8 +86,6 @@ public class BaseData implements BundleData {
cl = hooks[i].createClassLoader(parent, delegate, domain, this, bundleclasspath);
if (cl == null)
cl = new DefaultClassLoader(parent, delegate, domain, this, bundleclasspath);
- for (int i = 0; i < hooks.length; i++)
- hooks[i].initializedClassLoader(cl, this);
return cl;
}
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/hooks/ClassLoadingHook.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/hooks/ClassLoadingHook.java
index 0a5901c39..896b6d639 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/hooks/ClassLoadingHook.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/hooks/ClassLoadingHook.java
@@ -87,10 +87,10 @@ public interface ClassLoadingHook {
BaseClassLoader createClassLoader(ClassLoader parent, ClassLoaderDelegate delegate, BundleProtectionDomain domain, BaseData data, String[] bundleclasspath);
/**
- * Gets called by a base data during
- * {@link BundleData#createClassLoader(ClassLoaderDelegate, BundleProtectionDomain, String[])}.
- * The BaseData will call this method for each configured class loading hook after a
- * BundleClassLoader has been created.
+ * Gets called by a classpath manager at the end of
+ * {@link ClasspathManager#initialize()}.
+ * The classpath manager will call this method for each configured class loading hook after it
+ * has been initialized.
* @param baseClassLoader the newly created bundle classloader
* @param data the BundleData associated with the bundle classloader
*/
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java
index 6efd0a981..2a511eef3 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java
@@ -62,9 +62,16 @@ public class ClasspathManager {
/**
* initializes this classpath manager. This must be called after all existing fragments have been
* attached and before any resources/classes are loaded using this classpath manager.
+ * <p>
+ * After the classpath manager is initialized all configured class loading hooks
+ * {@link ClassLoadingHook#initializedClassLoader(BaseClassLoader, BaseData)} methods are called.
+ * </p>
*/
public void initialize() {
entries = buildClasspath(classpath, this, data, classloader.getDomain());
+ ClassLoadingHook[] hooks = data.getAdaptor().getHookRegistry().getClassLoadingHooks();
+ for (int i = 0; i < hooks.length; i++)
+ hooks[i].initializedClassLoader(classloader, data);
}
/**

Back to the top