summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-04 00:42:10 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-04 00:42:10 +0000
commitbfbb439e09596671c3019e3f53da16792e9b8c95 (patch)
tree5e97b767c0925655907e16702c85d7f70ef9942e /sca-java-2.x/trunk
parent1f5b13444e7c2d90ddd2b656f041cff20ddc7d04 (diff)
Make sure discovered remote service description and sca config is registered first before the listeners are notified
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@918796 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/LocalDiscoveryService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/LocalDiscoveryService.java b/sca-java-2.x/trunk/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/LocalDiscoveryService.java
index 89fd9ab853..320443c399 100644
--- a/sca-java-2.x/trunk/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/LocalDiscoveryService.java
+++ b/sca-java-2.x/trunk/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/LocalDiscoveryService.java
@@ -129,7 +129,7 @@ public class LocalDiscoveryService extends AbstractDiscoveryService implements B
}
public Object addingBundle(Bundle bundle, BundleEvent event) {
- if (bundle.getHeaders().get(Constants.FRAGMENT_HOST) != null) {
+ if (bundle.getHeaders().get(Constants.FRAGMENT_HOST) != null || bundle.getBundleId() == 0) {
// Ignore fragments
return null;
}
@@ -157,6 +157,9 @@ public class LocalDiscoveryService extends AbstractDiscoveryService implements B
// throw new ServiceRuntimeException(e);
}
}
+
+ // Add to the extenders before notifying the listeners (the endpoints may references to the config)
+ this.extenders.add(extender);
// Notify
for (ServiceDescriptions sds : extender.getRemoteServiceDescriptions()) {
@@ -167,7 +170,6 @@ public class LocalDiscoveryService extends AbstractDiscoveryService implements B
}
}
- this.extenders.add(extender);
return extender;
}