From c7da892cb23d50d4d85746c9a0b6b14bf570989d Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 26 Jun 2014 13:23:09 +0200 Subject: initial commit for Enea Linux 4.0 Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau --- .../org/yocto/remote/utils/CommandRunnable.java | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/CommandRunnable.java (limited to 'plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/CommandRunnable.java') 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 @@ +/******************************************************************************* + * Copyright (c) 2013 Intel Corporation. + * 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: + * Ioana Grigoropol(Intel) - initial API and implementation + *******************************************************************************/ +package org.yocto.remote.utils; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.rse.services.shells.IHostShell; + +public class CommandRunnable implements Runnable{ + private IHostShell hostShell; + private final IHost connection; + private final YoctoCommand cmd; + private final IProgressMonitor monitor; + private final CommandResponseHandler cmdHandler; + + CommandRunnable(IHost connection, YoctoCommand cmd, IProgressMonitor monitor){ + this.connection = connection; + this.cmdHandler = RemoteHelper.getCommandHandler(connection); + this.cmd = cmd; + this.monitor = monitor; + this.hostShell = null; + } + @Override + public void run() { + try { + hostShell = RemoteHelper.runCommandRemote(connection, cmd, monitor); + cmd.setProcessBuffer(RemoteHelper.processOutput(monitor, hostShell, cmdHandler)); + } catch (CoreException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} -- cgit v1.2.3-54-g00ecf