Package org.eclipse.remote.core

## Interface IRemoteProcess

All Known Implementing Classes:
  `SerialPortCommandShell`, `TelnetCommandShell`

    public interface IRemoteProcess

Represents a process running on a remote system. Remote process are created using the `IRemoteProcessBuilder` interface.

### Nested Class Summary

Nested Classes
`static interface` `IRemoteProcess.Service` The interface that is extend by services provided for this remote connection.

### Method Summary

All Methods Instance Methods Abstract Methods
`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 Note: some implementations (e.g.
`java.io.InputStream` `getInputStream()` Gets an InputStream which can be used to read the standard output stream of the process Note: some implementations (e.g.
`java.io.OutputStream` `getOutputStream()` Gets an output stream which can be used to write to the standard input stream of the process
`IRemoteProcessBuilder` `getProcessBuilder()` Get the process builder used to create this process
`IRemoteConnection` `getRemoteConnection()` Get the connection that is used by this process
`<T extends IRemoteProcess.Service> T` `getService​(java.lang.Class<T> service)` Get the service for this remote process that implements the given interface.
`<T extends IRemoteProcess.Service> boolean` `hasService​(java.lang.Class<T> service)` Does this remote process support the given service.
`boolean` `isCompleted()` Check if the remote process has completed.
`int` `waitFor()` Wait until the process has terminated Note: some implementations (e.g.

### Method Detail

#### destroy

    void destroy()

Terminate the process

#### exitValue

    int exitValue()

Returns the exit value for the process

Returns:
  the exit value

#### getErrorStream

    java.io.InputStream getErrorStream()

Gets the error output stream of the process Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding output or error streams.

Returns:
  the output stream connected to the standard error of the process

#### getInputStream

    java.io.InputStream getInputStream()

Gets an InputStream which can be used to read the standard output stream of the process Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding input or error streams.

Returns:
  the input stream connected to the standard output of the process

#### getOutputStream

    java.io.OutputStream getOutputStream()

Gets an output stream which can be used to write to the standard input stream of the process

Returns:
  the output stream connected to the standard input of the process

#### getService

    <T extends IRemoteProcess.Service> T getService​(java.lang.Class<T> service)

Get the service for this remote process that implements the given interface.

Parameters:
  `service` - the interface the required service must implements
Returns:
  the desired service or null if there is no such service available
Since:
  2.0

#### hasService

    <T extends IRemoteProcess.Service> boolean hasService​(java.lang.Class<T> service)

Does this remote process support the given service.

Parameters:
  `service` - The service to be tested
Returns:
  true if this connection supports the service
Since:
  2.0

#### waitFor

    int waitFor()
         throws java.lang.InterruptedException

Wait until the process has terminated Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding input or error streams.

Returns:
  the exit value of the process
Throws:
  `java.lang.InterruptedException` - if the current thread is interrupted by another thread while it is waiting

#### isCompleted

    boolean isCompleted()

Check if the remote process has completed. Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding input or error streams.

Returns:
  true if remote process has completed

#### getRemoteConnection

    IRemoteConnection getRemoteConnection()

Get the connection that is used by this process

Returns:
  connection used by this process
Since:
  2.0

#### getProcessBuilder

    IRemoteProcessBuilder getProcessBuilder()

Get the process builder used to create this process

Returns:
  process builder used to create this process
Since:
  2.0