diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:23:09 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:24:09 +0200 |
commit | c7da892cb23d50d4d85746c9a0b6b14bf570989d (patch) | |
tree | e7136073f386d6156f51766c498c52c30c8df85f /plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/CommandRunnable.java | |
download | eclipse-poky-kepler-c7da892cb23d50d4d85746c9a0b6b14bf570989d.tar.gz |
initial commit for Enea Linux 4.0daisy
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/CommandRunnable.java')
-rw-r--r-- | plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/CommandRunnable.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/CommandRunnable.java b/plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/CommandRunnable.java new file mode 100644 index 0000000..8cbda18 --- /dev/null +++ b/plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/CommandRunnable.java | |||
@@ -0,0 +1,44 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2013 Intel Corporation. | ||
3 | * All rights reserved. This program and the accompanying materials | ||
4 | * are made available under the terms of the Eclipse Public License v1.0 | ||
5 | * which accompanies this distribution, and is available at | ||
6 | * http://www.eclipse.org/legal/epl-v10.html | ||
7 | * | ||
8 | * Contributors: | ||
9 | * Ioana Grigoropol(Intel) - initial API and implementation | ||
10 | *******************************************************************************/ | ||
11 | package org.yocto.remote.utils; | ||
12 | |||
13 | import org.eclipse.core.runtime.CoreException; | ||
14 | import org.eclipse.core.runtime.IProgressMonitor; | ||
15 | import org.eclipse.rse.core.model.IHost; | ||
16 | import org.eclipse.rse.services.shells.IHostShell; | ||
17 | |||
18 | public class CommandRunnable implements Runnable{ | ||
19 | private IHostShell hostShell; | ||
20 | private final IHost connection; | ||
21 | private final YoctoCommand cmd; | ||
22 | private final IProgressMonitor monitor; | ||
23 | private final CommandResponseHandler cmdHandler; | ||
24 | |||
25 | CommandRunnable(IHost connection, YoctoCommand cmd, IProgressMonitor monitor){ | ||
26 | this.connection = connection; | ||
27 | this.cmdHandler = RemoteHelper.getCommandHandler(connection); | ||
28 | this.cmd = cmd; | ||
29 | this.monitor = monitor; | ||
30 | this.hostShell = null; | ||
31 | } | ||
32 | @Override | ||
33 | public void run() { | ||
34 | try { | ||
35 | hostShell = RemoteHelper.runCommandRemote(connection, cmd, monitor); | ||
36 | cmd.setProcessBuffer(RemoteHelper.processOutput(monitor, hostShell, cmdHandler)); | ||
37 | } catch (CoreException e) { | ||
38 | e.printStackTrace(); | ||
39 | } catch (Exception e) { | ||
40 | e.printStackTrace(); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | } | ||