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
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.
-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