diff options
author | Michael P. Masterson | 2016-12-02 23:25:02 +0000 |
---|---|---|
committer | Michael P. Masterson | 2016-12-02 23:25:02 +0000 |
commit | 1ed0028ccab788ab19af931e66a3fcd46056f4dd (patch) | |
tree | fdbe5423156ba08e7e34d863637c28a0916155c6 /plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse | |
parent | bff0b87335df8ec2f2585fe01d7ecfacd7ed303c (diff) | |
download | org.eclipse.osee-1ed0028ccab788ab19af931e66a3fcd46056f4dd.tar.gz org.eclipse.osee-1ed0028ccab788ab19af931e66a3fcd46056f4dd.tar.xz org.eclipse.osee-1ed0028ccab788ab19af931e66a3fcd46056f4dd.zip |
bug[ats_ATS326837]: Message Watch Recording not working in 0.23.1.
Client side now waits for an event that says the recording is complete
before closing down the connections.
Diffstat (limited to 'plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse')
-rw-r--r-- | plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java index e7d57bad92b..8b2018ffcf8 100644 --- a/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java +++ b/plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java @@ -44,16 +44,19 @@ import org.eclipse.osee.ote.message.tool.IFileTransferHandle; import org.eclipse.osee.ote.message.tool.MessageMode; import org.eclipse.osee.ote.message.tool.TransferConfig; import org.eclipse.osee.ote.message.tool.UdpFileTransferHandler; +import org.eclipse.osee.ote.remote.messages.RECORDING_COMPLETE; import org.eclipse.osee.ote.service.ConnectionEvent; import org.eclipse.osee.ote.service.IOteClientService; import org.eclipse.osee.ote.service.ITestConnectionListener; import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; +import org.osgi.service.event.Event; +import org.osgi.service.event.EventHandler; /** * @author Ken J. Aguilar */ -public class MessageSubscriptionService implements IOteMessageService, ITestConnectionListener, IMsgToolServiceClient { +public class MessageSubscriptionService implements IOteMessageService, ITestConnectionListener, IMsgToolServiceClient, EventHandler { /** * Static Fields ** */ private static final int MAX_CONCURRENT_WORKER_THREADS = Math.min(Runtime.getRuntime().availableProcessors() + 1, 4); @@ -329,14 +332,28 @@ public class MessageSubscriptionService implements IOteMessageService, ITestConn @Override public synchronized void stopRecording() throws RemoteException, IOException { - try { - MessageServiceSupport.stopRecording(); - } finally { + MessageServiceSupport.stopRecording(); + } + + /* (non-Javadoc) + * @see org.osgi.service.event.EventHandler#handleEvent(org.osgi.service.event.Event) + */ + @Override + public void handleEvent(Event event) { + if(event.getTopic().equals(RECORDING_COMPLETE.TOPIC)) { + if (fileTransferHandler != null && fileTransferHandler.hasActiveTransfers()) { - fileTransferHandler.stopAllTransfers(); + try { + fileTransferHandler.stopAllTransfers(); + } + catch (IOException ex) { + System.err.println(ex.getMessage()); + ex.printStackTrace(System.err); + } } fileTransferHandler = null; } + } public AbstractMessageDataBase getMsgDatabase() { |