diff options
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 * |