summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/extensibility-equinox
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules/extensibility-equinox')
-rw-r--r--java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java1
-rw-r--r--java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java5
2 files changed, 4 insertions, 2 deletions
diff --git a/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java b/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
index a9a0d6d3f6..4ccaf57c19 100644
--- a/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
+++ b/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
@@ -38,6 +38,7 @@ public class EquinoxServiceDiscoveryActivator implements BundleActivator {
}
public void stop(BundleContext context) throws Exception {
+ ServiceDiscovery.getInstance().setServiceDiscoverer(null);
}
}
diff --git a/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java b/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java
index bfa98ad725..51cb58f3b3 100644
--- a/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java
+++ b/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java
@@ -28,6 +28,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
import org.apache.tuscany.sca.core.LifeCycleListener;
import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
+import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -42,7 +43,7 @@ public class OSGiExtensionPointRegistry extends DefaultExtensionPointRegistry {
private BundleContext bundleContext;
public OSGiExtensionPointRegistry(BundleContext bundleContext) {
- super();
+ super(ServiceDiscovery.getInstance(new EquinoxServiceDiscoverer(bundleContext)));
this.bundleContext = bundleContext;
}
@@ -102,7 +103,7 @@ public class OSGiExtensionPointRegistry extends DefaultExtensionPointRegistry {
}
@Override
- public void stop() {
+ public synchronized void stop() {
// Get a unique map as an extension point may exist in the map by different keys
Map<LifeCycleListener, LifeCycleListener> map = new IdentityHashMap<LifeCycleListener, LifeCycleListener>();
for (ServiceRegistration reg : services.values()) {