Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServices.java5
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/ServiceNotification.java2
-rw-r--r--plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java18
-rw-r--r--plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/OteJmsServiceConnector.java13
4 files changed, 35 insertions, 3 deletions
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServices.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServices.java
index d5ace66e48..3b7b336520 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServices.java
+++ b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServices.java
@@ -269,5 +269,10 @@ public class TestMessageServices extends BaseBrokerTesting {
System.out.println("healthUpdates " + serviceUpdates);
}
+ @Override
+ public boolean isServiceGone(ServiceHealth serviceHealth) {
+ return true;
+ }
+
}
}
diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/ServiceNotification.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/ServiceNotification.java
index a18677a118..bbfda964bd 100644
--- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/ServiceNotification.java
+++ b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/ServiceNotification.java
@@ -19,4 +19,6 @@ public interface ServiceNotification {
void onServiceUpdate(ServiceHealth serviceHealth);
void onServiceGone(ServiceHealth serviceHealth);
+
+ boolean isServiceGone(ServiceHealth serviceHealth);
}
diff --git a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java
index 599fb59842..241546a001 100644
--- a/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java
+++ b/plugins/org.eclipse.osee.framework.messaging/src/org/eclipse/osee/framework/messaging/services/internal/MonitorTimedOutServices.java
@@ -18,6 +18,7 @@ import java.util.Set;
import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.messaging.services.ServiceNotification;
+import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth;
/**
* @author Andrew M. Finkbeiner
@@ -41,10 +42,12 @@ class MonitorTimedOutServices implements Runnable {
Map<String, ServiceHealthPlusTimeout> items = map.get(pair.getFirst(), pair.getSecond());
for (Entry<String, ServiceHealthPlusTimeout> key : items.entrySet()) {
if (key.getValue().isTimedOut(currentSystemTime)) {
- toRemove.add(new ThreeItems(pair.getFirst(), pair.getSecond(), key.getKey()));
List<ServiceNotification> list = callbacks.get(pair.getFirst(), pair.getSecond());
- for (ServiceNotification notify : list) {
- notify.onServiceGone(key.getValue().getServiceHealth());
+ if (isServiceReallyGone(list, key.getValue().getServiceHealth())) {
+ toRemove.add(new ThreeItems(pair.getFirst(), pair.getSecond(), key.getKey()));
+ for (ServiceNotification notify : list) {
+ notify.onServiceGone(key.getValue().getServiceHealth());
+ }
}
}
}
@@ -60,6 +63,15 @@ class MonitorTimedOutServices implements Runnable {
}
}
+ private boolean isServiceReallyGone(List<ServiceNotification> list, ServiceHealth serviceHealth) {
+ for (ServiceNotification notify : list) {
+ if (!notify.isServiceGone(serviceHealth)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
private static class ThreeItems {
String first;
diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/OteJmsServiceConnector.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/OteJmsServiceConnector.java
index def0ec4475..553001f504 100644
--- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/OteJmsServiceConnector.java
+++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/OteJmsServiceConnector.java
@@ -78,6 +78,19 @@ class OteJmsServiceConnector implements ServiceNotification, OseeMessagingStatus
}
}
+ @Override
+ public boolean isServiceGone(ServiceHealth serviceHealth) {
+ return serviceConfirmedGone(serviceHealth);
+ }
+
+ private boolean serviceConfirmedGone(ServiceHealth serviceHealth) {
+ JmsToJiniBridgeConnector connector = connectors.get(serviceHealth.getServiceUniqueId());
+ if (connector == null) {
+ return true;
+ }
+ return !connector.ping();
+ }
+
private JmsToJiniBridgeConnector removeExistingConnector(ServiceHealth serviceHealth) {
return connectors.remove(serviceHealth.getServiceUniqueId());
}

Back to the top