Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Alexander Kuppe2013-04-06 13:15:54 +0000
committerMarkus Alexander Kuppe2013-04-06 13:15:54 +0000
commitc416376e7c7c5add8cc008d16e973acb6d82d403 (patch)
tree5c481e150dabcc0128bf6f8cd3b38080930aa90f /compendium
parent01683bdc731f0d186f8f9bb48504a8c513a4bfea (diff)
downloadorg.eclipse.ecf-c416376e7c7c5add8cc008d16e973acb6d82d403.tar.gz
org.eclipse.ecf-c416376e7c7c5add8cc008d16e973acb6d82d403.tar.xz
org.eclipse.ecf-c416376e7c7c5add8cc008d16e973acb6d82d403.zip
NEW - bug 405027: Decouple service remoting from OSGi fw thread
https://bugs.eclipse.org/bugs/show_bug.cgi?id=405027 - One cannot always be elegant...
Diffstat (limited to 'compendium')
-rw-r--r--compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManager.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManager.java b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManager.java
index 0ccee18ef..431603bad 100644
--- a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManager.java
+++ b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManager.java
@@ -77,14 +77,25 @@ public class BasicTopologyManager extends AbstractTopologyManager implements
// Now export as if the service was registering right now...i.e.
// perform
// export
- if (existingServiceRefs != null && existingServiceRefs.length > 0)
- for (int i = 0; i < existingServiceRefs.length; i++)
+ if (existingServiceRefs != null && existingServiceRefs.length > 0) {
+ // After having collected all pre-registered services (with
+ // marker prop) we are going to asynchronously remote them.
+ // Registering potentially is a long-running operation (due to
+ // discovery I/O...) and thus should no be carried out in the
+ // OSGi FW thread. (https://bugs.eclipse.org/405027)
+ new Thread(new Runnable() {
+ public void run() {
+ for (int i = 0; i < existingServiceRefs.length; i++) {
// This method will check the service properties for
// remote service props. If previously registered as
// a
// remote service, it will export the remote
// service if not it will simply return/skip
handleServiceRegistering(existingServiceRefs[i]);
+ }
+ }
+ }, "BasicTopologyManagerPreRegSrvExporter").start(); //$NON-NLS-1$
+ }
} catch (InvalidSyntaxException e) {
logError(
"exportRegisteredServices", //$NON-NLS-1$

Back to the top