diff options
author | Andrew M Finkbeiner | 2012-04-22 21:02:58 +0000 |
---|---|---|
committer | Roberto E. Escobar | 2012-04-22 21:02:58 +0000 |
commit | 8547f6f7d080ea77db116bf3de207f05bef0c2de (patch) | |
tree | 9807c418c816b4ad776604c851e8c52dcc86566b /plugins | |
parent | c42706018a01a51e1add2318cf81e7a7578dc611 (diff) | |
download | org.eclipse.osee-8547f6f7d080ea77db116bf3de207f05bef0c2de.tar.gz org.eclipse.osee-8547f6f7d080ea77db116bf3de207f05bef0c2de.tar.xz org.eclipse.osee-8547f6f7d080ea77db116bf3de207f05bef0c2de.zip |
refinement: Make sure OTE client gets notified of server disconnects
Diffstat (limited to 'plugins')
2 files changed, 14 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java index fc32a4efbd0..df44c701157 100644 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java +++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java @@ -362,10 +362,11 @@ public class TestClientServiceImpl implements IOteClientService, IConnectorListe @Override public synchronized void onConnectorRemoved(IServiceConnector connector) { - testHosts.remove(connector.getUniqueServerId()); + String id = connector.getUniqueServerId(); + testHosts.remove(id); notifyHostUnavailable(connector, new OteServiceProperties(connector)); IHostTestEnvironment connectedHost = getConnectedHost(); - if (connectedHost != null) { + if (testConnection != null && testConnection.getId().equals(id)) { testConnection = null; listenerNotifier.notifyConnectionLost(connector); } diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestHostConnection.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestHostConnection.java index 84dff6afe22..f5948cecb62 100644 --- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestHostConnection.java +++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestHostConnection.java @@ -11,6 +11,7 @@ package org.eclipse.osee.ote.service.core; import java.rmi.RemoteException; + import org.eclipse.osee.connection.service.IServiceConnector; import org.eclipse.osee.ote.core.environment.UserTestSessionKey; import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment; @@ -28,6 +29,7 @@ class TestHostConnection { private final ITestEnvironment connectEnvironment; private final UserTestSessionKey sessionKey; private final IHostTestEnvironment host; + private String serverId; TestHostConnection(IServiceConnector connector, IHostTestEnvironment host, ITestEnvironment connectEnvironment, UserTestSessionKey sessionKey) { // intentionally package-private @@ -44,6 +46,11 @@ class TestHostConnection { this.host = host; this.connectEnvironment = connectEnvironment; this.sessionKey = sessionKey; + try { + this.serverId = (String) host.getProperties().getProperty("id"); + } catch (RemoteException e) { + this.serverId = ""; + } } /** @@ -74,6 +81,10 @@ class TestHostConnection { return serviceConnector; } + public String getId(){ + return serverId; + } + void endConnection() throws RemoteException { // intentionally package-private |