Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael P. Masterson2016-12-02 18:25:02 -0500
committerMichael P. Masterson2016-12-02 18:25:02 -0500
commit1ed0028ccab788ab19af931e66a3fcd46056f4dd (patch)
treefdbe5423156ba08e7e34d863637c28a0916155c6
parentbff0b87335df8ec2f2585fe01d7ecfacd7ed303c (diff)
downloadorg.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.
-rw-r--r--plugins/org.eclipse.osee.ote.client.msg/OSGI-INF/MessageSubscriptionServiceComponent.xml2
-rw-r--r--plugins/org.eclipse.osee.ote.client.msg/src/org/eclipse/osee/ote/client/msg/core/internal/MessageSubscriptionService.java27
-rw-r--r--plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/remote/messages/RECORDING_COMPLETE.java13
3 files changed, 37 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.ote.client.msg/OSGI-INF/MessageSubscriptionServiceComponent.xml b/plugins/org.eclipse.osee.ote.client.msg/OSGI-INF/MessageSubscriptionServiceComponent.xml
index c0a49c6201..948f5371d4 100644
--- a/plugins/org.eclipse.osee.ote.client.msg/OSGI-INF/MessageSubscriptionServiceComponent.xml
+++ b/plugins/org.eclipse.osee.ote.client.msg/OSGI-INF/MessageSubscriptionServiceComponent.xml
@@ -6,5 +6,7 @@
<service>
<provide interface="org.eclipse.osee.ote.client.msg.IOteMessageService"/>
<provide interface="org.eclipse.osee.ote.message.interfaces.IMsgToolServiceClient"/>
+ <provide interface="org.osgi.service.event.EventHandler"/>
</service>
+ <property name="event.topics" type="String" value="ote/message/recordingComplete"/>
</scr:component>
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 e7d57bad92..8b2018ffcf 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() {
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/remote/messages/RECORDING_COMPLETE.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/remote/messages/RECORDING_COMPLETE.java
new file mode 100644
index 0000000000..cfd525b261
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/remote/messages/RECORDING_COMPLETE.java
@@ -0,0 +1,13 @@
+package org.eclipse.osee.ote.remote.messages;
+
+import org.eclipse.osee.ote.message.event.OteEventMessage;
+
+public class RECORDING_COMPLETE extends OteEventMessage {
+
+ public static String TOPIC = "ote/message/recordingComplete";
+
+ public RECORDING_COMPLETE() {
+ super("RECORDING_COMPLETE", TOPIC, 0);
+ }
+
+}

Back to the top