Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Finkbeiner2010-09-12 08:40:55 -0400
committerRyan D. Brooks2010-09-12 08:40:55 -0400
commita0b43b3541c66b1ea17b0bb1953aa6056117a9f8 (patch)
tree70740c43ff53856efa60b16f2496259fc63c683f /plugins/org.eclipse.osee.framework.messaging
parentacf8feb603348f967cca295564fd8bd406dde004 (diff)
downloadorg.eclipse.osee-a0b43b3541c66b1ea17b0bb1953aa6056117a9f8.tar.gz
org.eclipse.osee-a0b43b3541c66b1ea17b0bb1953aa6056117a9f8.tar.xz
org.eclipse.osee-a0b43b3541c66b1ea17b0bb1953aa6056117a9f8.zip
bug: Update JMS service notification to have an additional function to test if the service is really gone
This makes test servers and test manager able to tolerate the JMS broker going down without causing disconnects or improper removal of running test servers from the host page and other test connection guis.
Diffstat (limited to 'plugins/org.eclipse.osee.framework.messaging')
-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
2 files changed, 17 insertions, 3 deletions
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;

Back to the top