Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2010-05-07 05:16:47 +0000
committerslewis2010-05-07 05:16:47 +0000
commite12c83fa75b6ff910997dc066b0a52fe47e4c3d0 (patch)
tree2ca9ffb413f74f756c9e4e17933b305538628b94 /examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host
parentb3e713b2042ac8ed8b231898db64798037d8c77e (diff)
downloadorg.eclipse.ecf-e12c83fa75b6ff910997dc066b0a52fe47e4c3d0.tar.gz
org.eclipse.ecf-e12c83fa75b6ff910997dc066b0a52fe47e4c3d0.tar.xz
org.eclipse.ecf-e12c83fa75b6ff910997dc066b0a52fe47e4c3d0.zip
Added proxy distribution listener to log distribution events
Diffstat (limited to 'examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host')
-rw-r--r--examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host/META-INF/MANIFEST.MF1
-rw-r--r--examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host/src/org/eclipse/ecf/internal/examples/remoteservices/hello/host/HelloHostApplication.java15
2 files changed, 15 insertions, 1 deletions
diff --git a/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host/META-INF/MANIFEST.MF b/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host/META-INF/MANIFEST.MF
index 6714a46fe..b5ece7c2a 100644
--- a/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host/META-INF/MANIFEST.MF
+++ b/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host/META-INF/MANIFEST.MF
@@ -11,6 +11,7 @@ Import-Package: org.eclipse.ecf.core;version="3.0.0",
org.eclipse.ecf.core.identity;version="3.0.0",
org.eclipse.ecf.examples.remoteservices.hello,
org.eclipse.ecf.examples.remoteservices.hello.impl,
+ org.eclipse.ecf.osgi.services.discovery;version="1.1.0",
org.eclipse.ecf.osgi.services.distribution;version="1.0.0",
org.eclipse.equinox.app;version="1.0.0",
org.osgi.framework,
diff --git a/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host/src/org/eclipse/ecf/internal/examples/remoteservices/hello/host/HelloHostApplication.java b/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host/src/org/eclipse/ecf/internal/examples/remoteservices/hello/host/HelloHostApplication.java
index 77e8021e3..824b08609 100644
--- a/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host/src/org/eclipse/ecf/internal/examples/remoteservices/hello/host/HelloHostApplication.java
+++ b/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host/src/org/eclipse/ecf/internal/examples/remoteservices/hello/host/HelloHostApplication.java
@@ -14,7 +14,11 @@ import java.util.Properties;
import org.eclipse.ecf.examples.remoteservices.hello.IHello;
import org.eclipse.ecf.examples.remoteservices.hello.impl.Hello;
+import org.eclipse.ecf.osgi.services.discovery.IHostDiscoveryListener;
+import org.eclipse.ecf.osgi.services.discovery.LoggingHostDiscoveryListener;
import org.eclipse.ecf.osgi.services.distribution.IDistributionConstants;
+import org.eclipse.ecf.osgi.services.distribution.IHostDistributionListener;
+import org.eclipse.ecf.osgi.services.distribution.LoggingHostDistributionListener;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.osgi.framework.BundleContext;
@@ -44,8 +48,17 @@ public class HelloHostApplication implements IApplication,
// Register host discovery listener to log the publish/unpublish of remote services.
// This LoggingHostDiscoveryListener logs the publication of OSGi remote services...so
// that the discovery can be more easily debugged.
- // bundleContext.registerService(IHostDiscoveryListener.class.getName(), new LoggingHostDiscoveryListener(), null);
+ // Note that other IHostDiscoveryListener may be created and registered, and
+ // all will be notified of publish/unpublish events
+ bundleContext.registerService(IHostDiscoveryListener.class.getName(), new LoggingHostDiscoveryListener(), null);
+ // Register host distribution listener to log the register/unregister of remote services.
+ // This LoggingHostDistributionListener logs the register/unregister of OSGi remote services...so
+ // that the distribution can be more easily debugged.
+ // Note that other IHostDistributionListener may be created and registered, and
+ // all will be notified of register/unregister events
+ bundleContext.registerService(IHostDistributionListener.class.getName(), new LoggingHostDistributionListener(), null);
+
// Setup properties for remote service distribution, as per OSGi 4.2 remote services
// specification (chap 13 in compendium spec)
Properties props = new Properties();

Back to the top