Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Alexander Kuppe2010-06-18 02:37:06 -0400
committerMarkus Alexander Kuppe2010-06-18 02:37:06 -0400
commite2e195c2ed4c0e84c5bc6692b63ef501678e27c5 (patch)
tree7474b865e38d88900f57953d3f40ed70320e475b /tests/bundles/org.eclipse.ecf.tests.provider.dnssd
parent5c4826a9c7655af49f61c470c88a05253e8d0232 (diff)
downloadorg.eclipse.ecf-e2e195c2ed4c0e84c5bc6692b63ef501678e27c5.tar.gz
org.eclipse.ecf-e2e195c2ed4c0e84c5bc6692b63ef501678e27c5.tar.xz
org.eclipse.ecf-e2e195c2ed4c0e84c5bc6692b63ef501678e27c5.zip
WIP - bug 314998: [Discovery][DNS-SD] Make provider configurable with Configuration Admin https://bugs.eclipse.org/bugs/show_bug.cgi?id=314998
Diffstat (limited to 'tests/bundles/org.eclipse.ecf.tests.provider.dnssd')
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.dnssd/src/org/eclipse/ecf/tests/provider/dnssd/Activator.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.dnssd/src/org/eclipse/ecf/tests/provider/dnssd/Activator.java b/tests/bundles/org.eclipse.ecf.tests.provider.dnssd/src/org/eclipse/ecf/tests/provider/dnssd/Activator.java
index 73a6a4fe3..4db332780 100644
--- a/tests/bundles/org.eclipse.ecf.tests.provider.dnssd/src/org/eclipse/ecf/tests/provider/dnssd/Activator.java
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.dnssd/src/org/eclipse/ecf/tests/provider/dnssd/Activator.java
@@ -18,7 +18,6 @@ import org.eclipse.ecf.provider.dnssd.IDnsSdDiscoveryConstants;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
-import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceListener;
@@ -43,7 +42,7 @@ public class Activator implements BundleActivator {
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(final BundleContext context) throws Exception {
- Filter filter = null;
+ String filter = "";
final ServiceReference configAdminServiceRef = context
.getServiceReference(ConfigurationAdmin.class.getName());
@@ -59,7 +58,7 @@ public class Activator implements BundleActivator {
properties.put(IDnsSdDiscoveryConstants.CA_RESOLVER, "8.8.8.8");
config.update(properties);
- filter = context.createFilter("(" + Constants.SERVICE_PID + "=" + config.getPid() + ")");
+ filter = context.createFilter("(" + Constants.SERVICE_PID + "=" + config.getPid() + ")").toString();
}
// add the service listener
@@ -75,12 +74,12 @@ public class Activator implements BundleActivator {
}
}
};
- context.addServiceListener(listener, filter.toString());
+ context.addServiceListener(listener, filter);
// try to get the service initially
ServiceReference[] references = null;
try {
- references = context.getServiceReferences(IDiscoveryLocator.class.getName(), filter.toString());
+ references = context.getServiceReferences(IDiscoveryLocator.class.getName(), filter);
} catch (InvalidSyntaxException e) {
// may never happen
e.printStackTrace();

Back to the top