Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2014-03-31 03:40:34 +0000
committerslewis2014-03-31 03:40:34 +0000
commit387d3378fe26db656d3ccbf3f23318a1b7ef988d (patch)
tree69005a0341417104b2fdc69cd7ba76da2733e1c0 /providers
parentc690aba14eb31e4fe085b0c6b80db497ad7bdbb8 (diff)
downloadorg.eclipse.ecf-387d3378fe26db656d3ccbf3f23318a1b7ef988d.tar.gz
org.eclipse.ecf-387d3378fe26db656d3ccbf3f23318a1b7ef988d.tar.xz
org.eclipse.ecf-387d3378fe26db656d3ccbf3f23318a1b7ef988d.zip
Additions to allow org.eclipse.ecf.provider.discovery to be usable
without extension registry bug 421569 Change-Id: I771e198fe86974f84da0ef536cabb81673a68b32
Diffstat (limited to 'providers')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/Activator.java18
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java4
2 files changed, 21 insertions, 1 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/Activator.java b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/Activator.java
index 829b484c1..ced3201c6 100644
--- a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/Activator.java
@@ -12,12 +12,16 @@ package org.eclipse.ecf.internal.provider.discovery;
import java.util.HashSet;
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.identity.Namespace;
+import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.discovery.IDiscoveryAdvertiser;
import org.eclipse.ecf.discovery.IDiscoveryLocator;
import org.eclipse.ecf.discovery.service.IDiscoveryService;
-import org.eclipse.ecf.provider.discovery.CompositeDiscoveryContainer;
+import org.eclipse.ecf.provider.discovery.*;
import org.osgi.framework.*;
import org.osgi.util.tracker.ServiceTracker;
@@ -47,6 +51,17 @@ public class Activator implements BundleActivator {
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(final BundleContext context) throws Exception {
+
+ SafeRunner.run(new ExtensionRegistryRunnable(context) {
+ protected void runWithoutRegistry() throws Exception {
+ context.registerService(Namespace.class, new CompositeNamespace(), null);
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.discovery.composite", new CompositeDiscoveryContainerInstantiator(), "Composite Discovery Container", true, false), null); //$NON-NLS-1$ //$NON-NLS-2$
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.singleton.discovery", new SingletonDiscoveryContainerInstantiator(), "Composite Discovery Container Locator", true, false), null); //$NON-NLS-1$ //$NON-NLS-2$
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.discovery.composite.locator", new CompositeDiscoveryContainerInstantiator(), "Composite Discovery Container Locator"), null); //$NON-NLS-1$ //$NON-NLS-2$
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.discovery.composite.advertiser", new CompositeDiscoveryContainerInstantiator(), "Composite Discovery Container Advertiser"), null); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+
final Properties props = new Properties();
props.put(IDiscoveryLocator.CONTAINER_NAME, CompositeDiscoveryContainer.NAME);
props.put(Constants.SERVICE_RANKING, new Integer(1000));
@@ -119,6 +134,7 @@ public class Activator implements BundleActivator {
((CompositeDiscoveryContainer) service).dispose();
}
}, props);
+
}
/*
diff --git a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java
index e37e23168..5ffc44e04 100644
--- a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java
@@ -20,6 +20,10 @@ public class CompositeNamespace extends Namespace {
private static final long serialVersionUID = -4774766051014928510L;
public static final String NAME = "ecf.namespace.composite"; //$NON-NLS-1$
+ public CompositeNamespace() {
+ super(NAME, "Composite Namespace"); //$NON-NLS-1$
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ecf.core.identity.Namespace#createInstance(java.lang.Object[])
*/

Back to the top