Package org.eclipse.remote.telnet.core
Class TelnetCommandShell
java.lang.Object
org.eclipse.remote.telnet.core.TelnetCommandShell
- All Implemented Interfaces:
IRemoteProcess
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.remote.core.IRemoteProcess
IRemoteProcess.Service
-
Constructor Summary
ConstructorDescriptionTelnetCommandShell
(IRemoteConnection remoteConnection, TelnetConnection telnetConnection) -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect()
void
destroy()
Terminate the processint
Returns the exit value for the processGets the error output stream of the process Note: some implementations (e.g.Gets an InputStream which can be used to read the standard output stream of the process Note: some implementations (e.g.Gets an output stream which can be used to write to the standard input stream of the processGet the process builder used to create this processGet the connection that is used by this process<T extends IRemoteProcess.Service>
TgetService
(Class<T> service) Get the service for this remote process that implements the given interface.<T extends IRemoteProcess.Service>
booleanhasService
(Class<T> service) Does this remote process support the given service.boolean
Check if the remote process has completed.protected void
int
waitFor()
Wait until the process has terminated Note: some implementations (e.g.
-
Constructor Details
-
TelnetCommandShell
-
-
Method Details
-
destroy
public void destroy()Description copied from interface:IRemoteProcess
Terminate the process- Specified by:
destroy
in interfaceIRemoteProcess
-
exitValue
public int exitValue()Description copied from interface:IRemoteProcess
Returns the exit value for the process- Specified by:
exitValue
in interfaceIRemoteProcess
- Returns:
- the exit value
-
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 interfaceIRemoteProcess
- Returns:
- the output stream connected to the standard error of the process
-
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 interfaceIRemoteProcess
- Returns:
- the input stream connected to the standard output of the process
-
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 interfaceIRemoteProcess
- Returns:
- the output stream connected to the standard input of the process
-
waitFor
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 interfaceIRemoteProcess
- Returns:
- the exit value of the process
- Throws:
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 interfaceIRemoteProcess
- Returns:
- true if remote process has completed
-
getRemoteConnection
Description copied from interface:IRemoteProcess
Get the connection that is used by this process- Specified by:
getRemoteConnection
in interfaceIRemoteProcess
- Returns:
- connection used by this process
-
getService
Description copied from interface:IRemoteProcess
Get the service for this remote process that implements the given interface.- Specified by:
getService
in interfaceIRemoteProcess
- Parameters:
service
- the interface the required service must implements- Returns:
- the desired service or null if there is no such service available
-
hasService
Description copied from interface:IRemoteProcess
Does this remote process support the given service.- Specified by:
hasService
in interfaceIRemoteProcess
- Parameters:
service
- The service to be tested- Returns:
- true if this connection supports the service
-
getProcessBuilder
Description copied from interface:IRemoteProcess
Get the process builder used to create this process- Specified by:
getProcessBuilder
in interfaceIRemoteProcess
- Returns:
- process builder used to create this process
-
connect
- Throws:
RemoteConnectionException
-
terminated
protected void terminated()
-