Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2011-08-24 12:38:17 -0400
committerslewis2011-08-24 12:38:17 -0400
commitaf351781639f9798e185a329186970771ee24680 (patch)
tree292a5b9e731490b1ee5cae511cb2fbddf15b457e
parent11490876eb33254cb816d4c4c28dd49fe849fa7f (diff)
downloadorg.eclipse.ecf-af351781639f9798e185a329186970771ee24680.tar.gz
org.eclipse.ecf-af351781639f9798e185a329186970771ee24680.tar.xz
org.eclipse.ecf-af351781639f9798e185a329186970771ee24680.zip
https://bugs.eclipse.org/bugs/show_bug.cgi?id=353835
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/node/internal/WatchManager.java24
1 files changed, 10 insertions, 14 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/node/internal/WatchManager.java b/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/node/internal/WatchManager.java
index 7c643e5d0..985fe3caf 100644
--- a/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/node/internal/WatchManager.java
+++ b/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/node/internal/WatchManager.java
@@ -75,25 +75,21 @@ public class WatchManager implements BundleStoppingListener {
nodeWriter.publish();
}
- public synchronized void publish(final AdvertisedService published) {
+ public void publish(AdvertisedService published) {
Assert.isNotNull(published);
String serviceid = published.getServiceID().getServiceTypeID()
.getInternal();
- if (WatchManager.this.getNodeWriters().containsKey(serviceid))
+ if (getNodeWriters().containsKey(serviceid))
return;
- if (!WatchManager.this.writeRootLock.isOpen()) {
- synchronized (WatchManager.this.writeRootLock) {
- try {
- /* wait for the server to get ready */
- WatchManager.this.writeRootLock.wait();
- } catch (InterruptedException e) {
- Logger.log(LogService.LOG_DEBUG, e.getMessage(), e);
- }
- }
+ try {
+ /* wait for the server to get ready */
+ while (!writeRootLock.isOpen())
+ Thread.sleep(300);
+ } catch (InterruptedException e) {
+ Logger.log(LogService.LOG_DEBUG, e.getMessage(), e);
}
- NodeWriter nodeWriter = new NodeWriter(published,
- WatchManager.this.writeRoot);
- WatchManager.this.getNodeWriters().put(serviceid, nodeWriter);
+ NodeWriter nodeWriter = new NodeWriter(published, writeRoot);
+ getNodeWriters().put(serviceid, nodeWriter);
allKnownServices.put(published.getServiceID().getName(), published);
nodeWriter.publish();
}

Back to the top