Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2014-03-31 03:50:56 +0000
committerslewis2014-03-31 03:50:56 +0000
commit4e613370ac1e29572d1c7f597de1adc701efcbbb (patch)
treefcf4fe7d74a5b464f6cc3b5add9a139bd8dcf5a1 /providers
parent387d3378fe26db656d3ccbf3f23318a1b7ef988d (diff)
downloadorg.eclipse.ecf-4e613370ac1e29572d1c7f597de1adc701efcbbb.tar.gz
org.eclipse.ecf-4e613370ac1e29572d1c7f597de1adc701efcbbb.tar.xz
org.eclipse.ecf-4e613370ac1e29572d1c7f597de1adc701efcbbb.zip
Additions to allow org.eclipse.ecf.provider.dnssd to be used without
extension registry bug 421569 Change-Id: Iee2d9793b10eee155535cedb4da1f848db6739f2
Diffstat (limited to 'providers')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.dnssd/META-INF/MANIFEST.MF2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.dnssd/plugin.xml4
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/Activator.java14
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/DnsSdNamespace.java4
4 files changed, 20 insertions, 4 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.dnssd/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.dnssd/META-INF/MANIFEST.MF
index f5b132cb8..2b7a86804 100644
--- a/providers/bundles/org.eclipse.ecf.provider.dnssd/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.dnssd/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ecf.provider.dnssd;singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.2.0.qualifier
Bundle-Activator: org.eclipse.ecf.provider.dnssd.Activator
Bundle-Vendor: %pluginProvider
Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/providers/bundles/org.eclipse.ecf.provider.dnssd/plugin.xml b/providers/bundles/org.eclipse.ecf.provider.dnssd/plugin.xml
index a93033e6b..43aac56d7 100644
--- a/providers/bundles/org.eclipse.ecf.provider.dnssd/plugin.xml
+++ b/providers/bundles/org.eclipse.ecf.provider.dnssd/plugin.xml
@@ -5,7 +5,7 @@
point="org.eclipse.ecf.containerFactory">
<containerFactory
class="org.eclipse.ecf.provider.dnssd.ContainerInstantiator"
- description="Discovery Locator Container "
+ description="Discovery Locator Container"
name="ecf.discovery.dnssd.locator">
</containerFactory>
</extension>
@@ -13,7 +13,7 @@
point="org.eclipse.ecf.containerFactory">
<containerFactory
class="org.eclipse.ecf.provider.dnssd.ContainerInstantiator"
- description="Discovery Advertiser Container "
+ description="Discovery Advertiser Container"
name="ecf.discovery.dnssd.advertiser">
</containerFactory>
</extension>
diff --git a/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/Activator.java b/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/Activator.java
index b60c52fbb..d5471c4e5 100644
--- a/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/Activator.java
@@ -16,8 +16,12 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
+import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.ecf.core.ContainerConnectException;
+import org.eclipse.ecf.core.ContainerTypeDescription;
import org.eclipse.ecf.core.IContainer;
+import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
import org.eclipse.ecf.discovery.IDiscoveryAdvertiser;
import org.eclipse.ecf.discovery.IDiscoveryLocator;
import org.osgi.framework.Bundle;
@@ -46,9 +50,17 @@ public class Activator implements BundleActivator {
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
- public void start(BundleContext context) throws Exception {
+ public void start(final BundleContext context) throws Exception {
this.context = context;
+ SafeRunner.run(new ExtensionRegistryRunnable(context) {
+ protected void runWithoutRegistry() throws Exception {
+ context.registerService(Namespace.class, new DnsSdNamespace(), null);
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(DISCOVERY_CONTAINER_NAME_VALUE + LOCATOR,new ContainerInstantiator(),"Discovery Locator Container"), null);
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(DISCOVERY_CONTAINER_NAME_VALUE + ADVERTISER,new ContainerInstantiator(),"Discovery Advertiser Container"), null);
+ }
+ });
+
// register a managed factory for the locator service
final Properties locCmProps = new Properties();
locCmProps.put(Constants.SERVICE_PID, DISCOVERY_CONTAINER_NAME_VALUE + LOCATOR);
diff --git a/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/DnsSdNamespace.java b/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/DnsSdNamespace.java
index 57bb9a9ef..7c1c2ac41 100644
--- a/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/DnsSdNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/DnsSdNamespace.java
@@ -26,6 +26,10 @@ public class DnsSdNamespace extends Namespace {
public static final String SCHEME = "dnssd"; //$NON-NLS-1$
public static final String NAME = "ecf.namespace.dnssd"; //$NON-NLS-1$
+ public DnsSdNamespace() {
+ super(NAME,"Dns SD Namespace");
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ecf.core.identity.Namespace#createInstance(java.lang.Object[])
*/

Back to the top