public class JSchProcess extends java.lang.Object implements IRemoteProcessControlService, IRemoteProcessSignalService, IRemoteProcessTerminalService
Modifier and Type | Class and Description |
---|---|
static class |
JSchProcess.Factory |
class |
JSchProcess.NullInputStream |
Constructor and Description |
---|
JSchProcess(IRemoteProcess process) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Terminate the process
|
int |
exitValue()
Returns the exit value for the process
|
java.io.InputStream |
getErrorStream()
Gets the error output stream of the process
|
java.io.InputStream |
getInputStream()
Gets an InputStream which can be used to read the standard output stream of the process
|
java.io.OutputStream |
getOutputStream()
Gets an output stream which can be used to write to the standard input stream of the process
|
IRemoteProcess |
getRemoteProcess() |
boolean |
isCompleted()
Check if the remote process has completed
|
void |
sendSignal(int signal)
Send a signal to the remote process.
|
void |
setTerminalSize(int cols,
int rows,
int width,
int height)
Change the terminal window dimension interactively.
|
int |
waitFor()
Wait until the process has terminated
|
public JSchProcess(IRemoteProcess process)
public void destroy()
IRemoteProcessControlService
destroy
in interface IRemoteProcessControlService
public int exitValue()
IRemoteProcessControlService
exitValue
in interface IRemoteProcessControlService
public java.io.InputStream getErrorStream()
IRemoteProcessControlService
getErrorStream
in interface IRemoteProcessControlService
public java.io.InputStream getInputStream()
IRemoteProcessControlService
getInputStream
in interface IRemoteProcessControlService
public java.io.OutputStream getOutputStream()
IRemoteProcessControlService
getOutputStream
in interface IRemoteProcessControlService
public int waitFor() throws java.lang.InterruptedException
IRemoteProcessControlService
waitFor
in interface IRemoteProcessControlService
java.lang.InterruptedException
- if the current thread is
interrupted by another thread while it is waitingpublic boolean isCompleted()
IRemoteProcessControlService
isCompleted
in interface IRemoteProcessControlService
public IRemoteProcess getRemoteProcess()
getRemoteProcess
in interface IRemoteProcess.Service
public void setTerminalSize(int cols, int rows, int width, int height)
IRemoteProcessTerminalService
setTerminalSize
in interface IRemoteProcessTerminalService
cols
- terminal width in charactersrows
- terminal height in characterswidth
- terminal width in pixelsheight
- terminal height in pixelspublic void sendSignal(int signal) throws RemoteConnectionException
IRemoteProcessSignalService
sendSignal
in interface IRemoteProcessSignalService
signal
- signal to send.RemoteConnectionException
- if the underlying connection fails