Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkuppe2008-06-12 05:51:44 -0400
committermkuppe2008-06-12 05:51:44 -0400
commit75e9bb6bf101ccdc69743251ddad2c8473a2fbf5 (patch)
tree32f5e96d6ea7bd9810fef5e1fe8612672c43869e
parentfff17ebf0b3a2082316eba9542158b9870b0e205 (diff)
downloadorg.eclipse.ecf-75e9bb6bf101ccdc69743251ddad2c8473a2fbf5.tar.gz
org.eclipse.ecf-75e9bb6bf101ccdc69743251ddad2c8473a2fbf5.tar.xz
org.eclipse.ecf-75e9bb6bf101ccdc69743251ddad2c8473a2fbf5.zip
RESOLVED - bug 236827: [Discovery] discovery.ui may use composite container
https://bugs.eclipse.org/bugs/show_bug.cgi?id=236827
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/DiscoveryView.java3
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/Activator.java10
2 files changed, 10 insertions, 3 deletions
diff --git a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/DiscoveryView.java b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/DiscoveryView.java
index e93b8c368..3c20697e6 100644
--- a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/DiscoveryView.java
+++ b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/discovery/ui/views/DiscoveryView.java
@@ -16,7 +16,6 @@ import org.eclipse.core.runtime.*;
import org.eclipse.ecf.core.ContainerFactory;
import org.eclipse.ecf.discovery.*;
import org.eclipse.ecf.discovery.identity.IServiceID;
-import org.eclipse.ecf.discovery.service.IDiscoveryService;
import org.eclipse.ecf.internal.discovery.ui.*;
import org.eclipse.jface.action.*;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -112,7 +111,7 @@ public class DiscoveryView extends ViewPart implements ITabbedPropertySheetPageC
protected IDiscoveryContainerAdapter getDiscovery() {
if (discoveryServiceTracker == null) {
- discoveryServiceTracker = new ServiceTracker(Activator.getContext(), IDiscoveryService.class.getName(), new ServiceTrackerCustomizer() {
+ discoveryServiceTracker = new ServiceTracker(Activator.getContext(), Activator.getFilter(), new ServiceTrackerCustomizer() {
public Object addingService(ServiceReference reference) {
final Object result = Activator.getContext().getService(reference);
diff --git a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/Activator.java b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/Activator.java
index a50dab754..ee3cff43f 100644
--- a/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/Activator.java
+++ b/framework/bundles/org.eclipse.ecf.discovery.ui/src/org/eclipse/ecf/internal/discovery/ui/Activator.java
@@ -12,10 +12,11 @@ package org.eclipse.ecf.internal.discovery.ui;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.ecf.core.IContainerManager;
+import org.eclipse.ecf.discovery.service.IDiscoveryService;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
+import org.osgi.framework.*;
import org.osgi.util.tracker.ServiceTracker;
/**
@@ -29,6 +30,8 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
+ private static Filter filter;
+
private BundleContext context;
private ServiceTracker extensionRegistryTracker = null;
@@ -58,6 +61,7 @@ public class Activator extends AbstractUIPlugin {
super.start(context1);
plugin = this;
this.context = context1;
+ filter = context.createFilter("(&(" + Constants.OBJECTCLASS + "=" + IDiscoveryService.class.getName() + ")(" + IDiscoveryService.CONTAINER_NAME + "=ecf.discovery.composite))"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ImageRegistry imageRegistry = getImageRegistry();
imageRegistry.put("serviceIcon", imageDescriptorFromPlugin(PLUGIN_ID, "icons/default_provider_image.gif").createImage()); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -96,6 +100,10 @@ public class Activator extends AbstractUIPlugin {
return getDefault().context;
}
+ public static Filter getFilter() {
+ return getDefault().filter;
+ }
+
/**
* Returns the shared instance
*

Back to the top