summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/extensibility-osgi
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-08-08 18:45:38 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-08-08 18:45:38 +0000
commit8d36182a275767a084304a642a19353a55ec062a (patch)
tree4ab9136261317cc452dd23a34831bbed299a24ee /java/sca/modules/extensibility-osgi
parente0878433b226e502b36eb8d189f79df3387c12f6 (diff)
Use ServiceDiscovery in node2-api to find SCANode2Factory subclasses
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@684046 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/extensibility-osgi')
-rw-r--r--java/sca/modules/extensibility-osgi/src/main/java/org/apache/tuscany/sca/extensibility/osgi/OSGiServiceDiscoveryActivator.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/java/sca/modules/extensibility-osgi/src/main/java/org/apache/tuscany/sca/extensibility/osgi/OSGiServiceDiscoveryActivator.java b/java/sca/modules/extensibility-osgi/src/main/java/org/apache/tuscany/sca/extensibility/osgi/OSGiServiceDiscoveryActivator.java
index 0a58776754..b69f36d383 100644
--- a/java/sca/modules/extensibility-osgi/src/main/java/org/apache/tuscany/sca/extensibility/osgi/OSGiServiceDiscoveryActivator.java
+++ b/java/sca/modules/extensibility-osgi/src/main/java/org/apache/tuscany/sca/extensibility/osgi/OSGiServiceDiscoveryActivator.java
@@ -27,13 +27,18 @@ import org.osgi.framework.BundleContext;
* The Bundle Activator that creates the OSGi-based service discoverer
*/
public class OSGiServiceDiscoveryActivator implements BundleActivator {
+ private static BundleContext bundleContext;
public void start(BundleContext context) throws Exception {
- OSGiServiceDiscoverer discoverer = new OSGiServiceDiscoverer(context);
- ServiceDiscovery.setServiceDiscoverer(discoverer);
+ if (bundleContext == null) {
+ bundleContext = context;
+ OSGiServiceDiscoverer discoverer = new OSGiServiceDiscoverer(bundleContext);
+ ServiceDiscovery.setServiceDiscoverer(discoverer);
+ }
}
- public void stop(BundleContext arg0) throws Exception {
+ public void stop(BundleContext context) throws Exception {
+ bundleContext = null;
// ServiceDiscovery.setServiceDiscoverer(discoverer);
}