org.eclipse.remote.telnet.core

## Class TelnetCommandShell

- java.lang.Object
- - org.eclipse.remote.telnet.core.TelnetCommandShell

All Implemented Interfaces:
  IRemoteProcess

    public class TelnetCommandShell
    extends java.lang.Object
    implements IRemoteProcess

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.eclipse.remote.core.IRemoteProcess

`IRemoteProcess.Service`

### Constructor Summary

Constructors
Constructor and Description
`TelnetCommandShell(IRemoteConnection remoteConnection, TelnetConnection telnetConnection)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `connect()`
`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.
`protected void` `terminated()`
`int` `waitFor()` Wait until the process has terminated Note: some implementations (e.g.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TelnetCommandShell

    public TelnetCommandShell(IRemoteConnection remoteConnection,
                              TelnetConnection telnetConnection)

### Method Detail

#### destroy

    public void destroy()

Description copied from interface: `IRemoteProcess`
Terminate the process

Specified by:
  `destroy` in interface `IRemoteProcess`

#### exitValue

    public int exitValue()

Description copied from interface: `IRemoteProcess`
Returns the exit value for the process

Specified by:
  `exitValue` in interface `IRemoteProcess`
Returns:
  the exit value

#### getErrorStream

    public java.io.InputStream getErrorStream()

Description copied from interface: `IRemoteProcess`
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.

Specified by:
  `getErrorStream` in interface `IRemoteProcess`
Returns:
  the output stream connected to the standard error of the process

#### getInputStream

    public java.io.InputStream getInputStream()

Description copied from interface: `IRemoteProcess`
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.

Specified by:
  `getInputStream` in interface `IRemoteProcess`
Returns:
  the input stream connected to the standard output of the process

#### getOutputStream

    public java.io.OutputStream getOutputStream()

Description copied from interface: `IRemoteProcess`
Gets an output stream which can be used to write to the standard input stream of the process

Specified by:
  `getOutputStream` in interface `IRemoteProcess`
Returns:
  the output stream connected to the standard input of the process

#### waitFor

    public int waitFor()
                throws java.lang.InterruptedException

Description copied from interface: `IRemoteProcess`
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.

Specified by:
  `waitFor` in interface `IRemoteProcess`
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

    public boolean isCompleted()

Description copied from interface: `IRemoteProcess`
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.

Specified by:
  `isCompleted` in interface `IRemoteProcess`
Returns:
  true if remote process has completed

#### getRemoteConnection

    public IRemoteConnection getRemoteConnection()

Description copied from interface: `IRemoteProcess`
Get the connection that is used by this process

Specified by:
  `getRemoteConnection` in interface `IRemoteProcess`
Returns:
  connection used by this process

#### getService

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

Description copied from interface: `IRemoteProcess`
Get the service for this remote process that implements the given interface.

Specified by:
  `getService` in interface `IRemoteProcess`
Parameters:
  `service` - the interface the required service must implements
Returns:
  the desired service or null if there is no such service available

#### hasService

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

Description copied from interface: `IRemoteProcess`
Does this remote process support the given service.

Specified by:
  `hasService` in interface `IRemoteProcess`
Parameters:
  `service` - The service to be tested
Returns:
  true if this connection supports the service

#### getProcessBuilder

    public IRemoteProcessBuilder getProcessBuilder()

Description copied from interface: `IRemoteProcess`
Get the process builder used to create this process

Specified by:
  `getProcessBuilder` in interface `IRemoteProcess`
Returns:
  process builder used to create this process

#### connect

    public void connect()
                 throws RemoteConnectionException

Throws:
  `RemoteConnectionException`

#### terminated

    protected void terminated()