Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Lippert2008-08-18 09:35:03 +0000
committerMartin Lippert2008-08-18 09:35:03 +0000
commit76f8c64f3d7dc2044b9652559cd62cd7a1510ab6 (patch)
treed31fb71b9df91fba0eae668a8f19c6d85856db52
parenta08488e8d48540003018b4da9cd0ee6cc5e9fc14 (diff)
downloadrt.equinox.bundles-76f8c64f3d7dc2044b9652559cd62cd7a1510ab6.tar.gz
rt.equinox.bundles-76f8c64f3d7dc2044b9652559cd62cd7a1510ab6.tar.xz
rt.equinox.bundles-76f8c64f3d7dc2044b9652559cd62cd7a1510ab6.zip
Bug 243681 - [aspects] supplementer mechanism broken without clean configuration, supplementer registry state now re-build at startup
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJHook.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJHook.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJHook.java
index 1609a8ee4..a4b1c0206 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJHook.java
+++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AspectJHook.java
@@ -16,6 +16,7 @@ package org.eclipse.equinox.weaving.hooks;
import java.io.IOException;
import java.net.URL;
+import org.eclipse.equinox.service.weaving.SupplementerRegistry;
import org.eclipse.equinox.weaving.adaptors.AspectJAdaptor;
import org.eclipse.equinox.weaving.adaptors.AspectJAdaptorFactory;
import org.eclipse.equinox.weaving.adaptors.Debug;
@@ -26,6 +27,7 @@ import org.eclipse.osgi.baseadaptor.bundlefile.BundleFile;
import org.eclipse.osgi.baseadaptor.loader.BaseClassLoader;
import org.eclipse.osgi.baseadaptor.loader.ClasspathEntry;
import org.eclipse.osgi.baseadaptor.loader.ClasspathManager;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
@@ -184,17 +186,25 @@ public class AspectJHook extends AbstractAspectJHook {
Debug.println("> AspectJHook.initialize() context=" + context);
this.bundleContext = context;
- adaptorFactory.initialize(context, getSupplementerRegistry());
+
+ final SupplementerRegistry supplementerRegistry = getSupplementerRegistry();
+ adaptorFactory.initialize(context, supplementerRegistry);
final ServiceReference serviceReference = context
.getServiceReference(PackageAdmin.class.getName());
final PackageAdmin packageAdmin = (PackageAdmin) context
.getService(serviceReference);
- getSupplementerRegistry().setBundleContext(context);
- getSupplementerRegistry().setPackageAdmin(packageAdmin);
+ supplementerRegistry.setBundleContext(context);
+ supplementerRegistry.setPackageAdmin(packageAdmin);
context.addBundleListener(new SupplementBundleListener(
- getSupplementerRegistry()));
+ supplementerRegistry));
+
+ // re-build supplementer registry state for installed bundles
+ final Bundle[] installedBundles = context.getBundles();
+ for (int i = 0; i < installedBundles.length; i++) {
+ supplementerRegistry.addSupplementer(installedBundles[i]);
+ }
if (Debug.DEBUG_GENERAL)
Debug.println("< AspectJHook.initialize() adaptorFactory="

Back to the top