summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-2.0-M4/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DomainDiscoveryService.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--branches/sca-java-2.0-M4/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DomainDiscoveryService.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/branches/sca-java-2.0-M4/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DomainDiscoveryService.java b/branches/sca-java-2.0-M4/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DomainDiscoveryService.java
index 2577a68808..bf70c98634 100644
--- a/branches/sca-java-2.0-M4/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DomainDiscoveryService.java
+++ b/branches/sca-java-2.0-M4/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DomainDiscoveryService.java
@@ -30,6 +30,7 @@ import org.apache.tuscany.sca.implementation.osgi.OSGiImplementation;
import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
import org.apache.tuscany.sca.runtime.DomainRegistryFactory;
import org.apache.tuscany.sca.runtime.EndpointListener;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
/**
@@ -56,8 +57,13 @@ public class DomainDiscoveryService extends AbstractDiscoveryService implements
return;
}
- OSGiImplementation osgiImpl = (OSGiImplementation)impl;
- BundleContext bundleContext = osgiImpl.getBundle().getBundleContext();
+ BundleContext bundleContext = null;
+ // Remote endpoint doesn't have a bundle
+ if (!endpoint.isRemote()) {
+ OSGiImplementation osgiImpl = (OSGiImplementation)impl;
+ Bundle bundle = osgiImpl.getBundle();
+ bundleContext = bundle != null ? bundle.getBundleContext() : null;
+ }
/*
if (!endpoint.isRemote()) {
@@ -114,4 +120,5 @@ public class DomainDiscoveryService extends AbstractDiscoveryService implements
props.put(SUPPORTED_PROTOCOLS, new String[] {"org.osgi.sca"});
return props;
}
+
}