Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2011-12-18 09:00:56 +0000
committerUwe Stieber2011-12-18 09:00:56 +0000
commit1bee2b5b8aa49b326e80d04884d7d188ea156998 (patch)
tree6ff37756a08bb70e0636c2ce8d703856eebe3016 /target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher
parent5b5dcf236034b834b3772f3b3bc9145a54c8d2b4 (diff)
downloadorg.eclipse.tcf-1bee2b5b8aa49b326e80d04884d7d188ea156998.tar.gz
org.eclipse.tcf-1bee2b5b8aa49b326e80d04884d7d188ea156998.tar.xz
org.eclipse.tcf-1bee2b5b8aa49b326e80d04884d7d188ea156998.zip
Target Explorer: Add communication monitor console
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java
index 52a17287c..ec65b0510 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java
@@ -156,6 +156,7 @@ public class ScriptLauncher extends PlatformObject implements IScriptLauncher {
@Override
public void onMessageSent(char type, String token, String service, String name, byte[] data) {
+ if (isFiltered(type, name)) return;
String message = formatMessage(type, token, service, name, data, false);
ScriptEvent event = new ScriptEvent(ScriptLauncher.this, ScriptEvent.Type.OUTPUT, new ScriptEvent.Message(type, message));
EventManager.getInstance().fireEvent(event);
@@ -163,6 +164,7 @@ public class ScriptLauncher extends PlatformObject implements IScriptLauncher {
@Override
public void onMessageReceived(char type, String token, String service, String name, byte[] data) {
+ if (isFiltered(type, name)) return;
String message = formatMessage(type, token, service, name, data, true);
ScriptEvent event = new ScriptEvent(ScriptLauncher.this, ScriptEvent.Type.OUTPUT, new ScriptEvent.Message(type, message));
EventManager.getInstance().fireEvent(event);
@@ -173,6 +175,26 @@ public class ScriptLauncher extends PlatformObject implements IScriptLauncher {
}
/**
+ * Checks if a given message is filtered. Filtered messages are not send to
+ * the script output console.
+ *
+ * @param type The message type.
+ * @param name The message name.
+ *
+ * @return <code>True</code> if the message is filtered, <code>false</code> otherwise.
+ */
+ private boolean isFiltered(char type, String name) {
+ boolean filtered = false;
+
+ // Filter out the heart beat and framework messages
+ if (type == 'F' || (name != null && name.toLowerCase().contains("heartbeat"))) { //$NON-NLS-1$
+ filtered = true;
+ }
+
+ return filtered;
+ }
+
+ /**
* Format the trace message.
*/
protected String formatMessage(char type, String token, String service, String name, byte[] data, boolean received) {

Back to the top