private class JschSession.JschProcess
extends java.lang.Process
Uses the Jsch session to do actual command execution and manage the execution.
Modifier and Type | Field and Description |
---|---|
private com.jcraft.jsch.ChannelExec |
channel |
private java.io.InputStream |
errStream |
private java.io.InputStream |
inputStream |
private java.io.OutputStream |
outputStream |
(package private) int |
timeout |
Constructor and Description |
---|
JschProcess(java.lang.String commandName,
int tms)
Opens a channel on the session ("sock") for executing the given
command, opens streams, and starts command execution.
|
Modifier and Type | Method and Description |
---|---|
private void |
closeOutputStream() |
void |
destroy() |
int |
exitValue() |
java.io.InputStream |
getErrorStream() |
java.io.InputStream |
getInputStream() |
java.io.OutputStream |
getOutputStream() |
private boolean |
isRunning() |
private void |
setupStreams() |
int |
waitFor() |
private com.jcraft.jsch.ChannelExec channel
final int timeout
private java.io.InputStream inputStream
private java.io.OutputStream outputStream
private java.io.InputStream errStream
JschProcess(java.lang.String commandName, int tms) throws TransportException, java.io.IOException
commandName
- the command to executetms
- the timeout value, in seconds, for the command.TransportException
- on problems opening a channel or connecting to the remote
hostjava.io.IOException
- on problems opening streamsprivate void closeOutputStream()
private void setupStreams() throws java.io.IOException
java.io.IOException
public java.io.InputStream getInputStream()
getInputStream
in class java.lang.Process
public java.io.OutputStream getOutputStream()
getOutputStream
in class java.lang.Process
public java.io.InputStream getErrorStream()
getErrorStream
in class java.lang.Process
public int exitValue()
exitValue
in class java.lang.Process
private boolean isRunning()
public void destroy()
destroy
in class java.lang.Process
public int waitFor() throws java.lang.InterruptedException
waitFor
in class java.lang.Process
java.lang.InterruptedException