Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStoyan Boshev2012-01-12 14:00:25 +0000
committerStoyan Boshev2012-01-12 14:00:25 +0000
commitbed7fe2c74ad8c6d5f419e737795a579dc586645 (patch)
treed7889650ad6e8471b3ebebd09e611ddc175b76e0 /bundles/org.eclipse.equinox.ds
parentbc90cc9f25f594afb11c27b3a37a56b82e3793a3 (diff)
downloadrt.equinox.bundles-bed7fe2c74ad8c6d5f419e737795a579dc586645.tar.gz
rt.equinox.bundles-bed7fe2c74ad8c6d5f419e737795a579dc586645.tar.xz
rt.equinox.bundles-bed7fe2c74ad8c6d5f419e737795a579dc586645.zip
Bug 335208 - [ds] component instantiated twice (static, immediate,v20120112-1400
servicefactory=false)
Diffstat (limited to 'bundles/org.eclipse.equinox.ds')
-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 1d6bdfbf0..7abb5b455 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 2a66437f2..a6aa1461b 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);
}
}

Back to the top