aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStoyan Boshev2012-01-12 09:00:25 (EST)
committerStoyan Boshev2012-01-12 09:00:25 (EST)
commitbed7fe2c74ad8c6d5f419e737795a579dc586645 (patch)
treed7889650ad6e8471b3ebebd09e611ddc175b76e0
parentbc90cc9f25f594afb11c27b3a37a56b82e3793a3 (diff)
downloadrt.equinox.bundles-bed7fe2c74ad8c6d5f419e737795a579dc586645.zip
rt.equinox.bundles-bed7fe2c74ad8c6d5f419e737795a579dc586645.tar.gz
rt.equinox.bundles-bed7fe2c74ad8c6d5f419e737795a579dc586645.tar.bz2
Bug 335208 - [ds] component instantiated twice (static, immediate,v20120112-1400
servicefactory=false)
-rw-r--r--bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/Resolver.java4
-rw-r--r--bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/SCRManager.java20
2 files changed, 22 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/Resolver.java b/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/Resolver.java
index 1d6bdfb..7abb5b4 100644
--- a/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/Resolver.java
+++ b/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/Resolver.java
@@ -148,6 +148,10 @@ public final class Resolver implements WorkPerformer {
}
continue;
}
+ if (current.componentProps != null && current.componentProps.size() > 0) {
+ //component is already enabled and processed. Skipping it.
+ continue;
+ }
current.setState(Component.STATE_UNSATISFIED);
diff --git a/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/SCRManager.java b/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/SCRManager.java
index 2a66437..a6aa146 100644
--- a/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/SCRManager.java
+++ b/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/SCRManager.java
@@ -50,6 +50,7 @@ public class SCRManager implements ServiceListener, SynchronousBundleListener, C
public final int DISABLE_COMPONENTS = 2;
protected Hashtable bundleToServiceComponents;
+ protected Hashtable processingBundles = new Hashtable(5);
protected Queue queue;
private Resolver resolver;
@@ -566,6 +567,21 @@ public class SCRManager implements ServiceListener, SynchronousBundleListener, C
}
void startedBundle(Bundle bundle) {
+ synchronized (processingBundles) {
+ if (processingBundles.get(bundle) != null) {
+ //the bundle is already being processed
+ return;
+ }
+ processingBundles.put(bundle, ""); //$NON-NLS-1$
+ }
+ try {
+ startedBundle2(bundle);
+ } finally {
+ processingBundles.remove(bundle);
+ }
+ }
+
+ void startedBundle2(Bundle bundle) {
long start = 0l;
if (Activator.PERF) {
start = System.currentTimeMillis();
@@ -853,7 +869,7 @@ public class SCRManager implements ServiceListener, SynchronousBundleListener, C
} else {
//process the component configurations and eventually modify or restart them
ConfigurationEvent ce = new ConfigurationEvent(caReference, ConfigurationEvent.CM_UPDATED, configs[j].getFactoryPid(), configs[j].getPid());
- processConfigurationEvent(ce, sc);
+ configurationEvent(ce);
}
break;
}
@@ -863,7 +879,7 @@ public class SCRManager implements ServiceListener, SynchronousBundleListener, C
}
}
if (toProcess.size() > 0) {
- resolver.enableComponents(toProcess);
+ enqueueWork(this, ENABLE_COMPONENTS, toProcess, false);
}
}