Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-09-08 08:09:12 +0000
committerUwe Stieber2012-09-10 07:03:39 +0000
commit358c51348086a1206f1a99b43dd3c140ee93cf75 (patch)
tree11b30e3c15e50e970f00bb70b297a5fe963821e9 /target_explorer/plugins/org.eclipse.tcf.te.tests
parent4487757b62b48593adf91ff17e5dfc344d7680d7 (diff)
downloadorg.eclipse.tcf-358c51348086a1206f1a99b43dd3c140ee93cf75.tar.gz
org.eclipse.tcf-358c51348086a1206f1a99b43dd3c140ee93cf75.tar.xz
org.eclipse.tcf-358c51348086a1206f1a99b43dd3c140ee93cf75.zip
Target Explorer: Improve process output reader thread tracing
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tests')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/AgentLauncher.java172
1 files changed, 86 insertions, 86 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/AgentLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/AgentLauncher.java
index 216f94e24..b8f770786 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/AgentLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/AgentLauncher.java
@@ -1,86 +1,86 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tests.tcf;
-
-import java.io.InputStream;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.tcf.te.runtime.interfaces.IDisposable;
-import org.eclipse.tcf.te.runtime.processes.ProcessLauncher;
-import org.eclipse.tcf.te.runtime.processes.ProcessOutputReaderThread;
-import org.eclipse.tcf.te.runtime.utils.Host;
-
-/**
- * TCF tests agent launcher implementation.
- */
-public class AgentLauncher extends ProcessLauncher implements IDisposable {
- // The path of the agent to launch
- private final IPath path;
- // The process handle
- private Process process;
- // The process output reader
- private ProcessOutputReaderThread outputReader;
-
- /**
- * Constructor.
- *
- * @param path The agent path. Must not be <code>null</code>.
- */
- public AgentLauncher(IPath path) {
- super(null, null, 0);
- Assert.isNotNull(path);
- this.path = path;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.IDisposable#dispose()
- */
- @Override
- public void dispose() {
- if (process != null) {
- process.destroy();
- process = null;
- }
- }
-
- /**
- * Returns the process handle.
- *
- * @return The process handle or <code>null</code>.
- */
- public Process getProcess() {
- return process;
- }
-
- /**
- * Returns the process output reader.
- *
- * @return The process output reader or <code>null</code>.
- */
- public ProcessOutputReaderThread getOutputReader() {
- return outputReader;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.processes.ProcessLauncher#launch()
- */
- @Override
- public void launch() throws Throwable {
- IPath dir = path.removeLastSegments(1);
- String cmd = Host.isWindowsHost() ? path.toOSString() : "./" + path.lastSegment(); //$NON-NLS-1$
- process = Runtime.getRuntime().exec(new String[] { cmd, "-S" }, null, dir.toFile()); //$NON-NLS-1$
-
- // Launch the process output reader
- outputReader = new ProcessOutputReaderThread(null, new InputStream[] { process.getInputStream() });
- outputReader.start();
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tests.tcf;
+
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.tcf.te.runtime.interfaces.IDisposable;
+import org.eclipse.tcf.te.runtime.processes.ProcessLauncher;
+import org.eclipse.tcf.te.runtime.processes.ProcessOutputReaderThread;
+import org.eclipse.tcf.te.runtime.utils.Host;
+
+/**
+ * TCF tests agent launcher implementation.
+ */
+public class AgentLauncher extends ProcessLauncher implements IDisposable {
+ // The path of the agent to launch
+ private final IPath path;
+ // The process handle
+ private Process process;
+ // The process output reader
+ private ProcessOutputReaderThread outputReader;
+
+ /**
+ * Constructor.
+ *
+ * @param path The agent path. Must not be <code>null</code>.
+ */
+ public AgentLauncher(IPath path) {
+ super(null, null, 0);
+ Assert.isNotNull(path);
+ this.path = path;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.interfaces.IDisposable#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (process != null) {
+ process.destroy();
+ process = null;
+ }
+ }
+
+ /**
+ * Returns the process handle.
+ *
+ * @return The process handle or <code>null</code>.
+ */
+ public Process getProcess() {
+ return process;
+ }
+
+ /**
+ * Returns the process output reader.
+ *
+ * @return The process output reader or <code>null</code>.
+ */
+ public ProcessOutputReaderThread getOutputReader() {
+ return outputReader;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.processes.ProcessLauncher#launch()
+ */
+ @Override
+ public void launch() throws Throwable {
+ IPath dir = path.removeLastSegments(1);
+ String cmd = Host.isWindowsHost() ? path.toOSString() : "./" + path.lastSegment(); //$NON-NLS-1$
+ process = Runtime.getRuntime().exec(new String[] { cmd, "-S" }, null, dir.toFile()); //$NON-NLS-1$
+
+ // Launch the process output reader
+ outputReader = new ProcessOutputReaderThread(path.lastSegment(), new InputStream[] { process.getInputStream() });
+ outputReader.start();
+ }
+
+}

Back to the top