Package org.eclipse.jgit.transport
Class JschSession.JschProcess
- java.lang.Object
-
- java.lang.Process
-
- org.eclipse.jgit.transport.JschSession.JschProcess
-
- Enclosing class:
- JschSession
private class JschSession.JschProcess extends java.lang.Process
Implementation of Process for running a single command using Jsch.Uses the Jsch session to do actual command execution and manage the execution.
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description JschProcess(java.lang.String commandName, java.util.Map<java.lang.String,java.lang.String> environment, int tms)
Opens a channel on the session ("sock") for executing the given command, opens streams, and starts command execution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
-
-
Constructor Detail
-
JschProcess
JschProcess(java.lang.String commandName, java.util.Map<java.lang.String,java.lang.String> environment, int tms) throws TransportException, java.io.IOException
Opens a channel on the session ("sock") for executing the given command, opens streams, and starts command execution.- Parameters:
commandName
- the command to executeenvironment
- environment variables to pass ontms
- the timeout value, in seconds, for the command.- Throws:
TransportException
- on problems opening a channel or connecting to the remote hostjava.io.IOException
- on problems opening streams
-
-
Method Detail
-
closeOutputStream
private void closeOutputStream()
-
setupStreams
private void setupStreams() throws java.io.IOException
- Throws:
java.io.IOException
-
getInputStream
public java.io.InputStream getInputStream()
- Specified by:
getInputStream
in classjava.lang.Process
-
getOutputStream
public java.io.OutputStream getOutputStream()
- Specified by:
getOutputStream
in classjava.lang.Process
-
getErrorStream
public java.io.InputStream getErrorStream()
- Specified by:
getErrorStream
in classjava.lang.Process
-
exitValue
public int exitValue()
- Specified by:
exitValue
in classjava.lang.Process
-
isRunning
private boolean isRunning()
-
destroy
public void destroy()
- Specified by:
destroy
in classjava.lang.Process
-
waitFor
public int waitFor() throws java.lang.InterruptedException
- Specified by:
waitFor
in classjava.lang.Process
- Throws:
java.lang.InterruptedException
-
-