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
ConstructorsConstructorDescriptionTelnetCommandShell(IRemoteConnection remoteConnection, TelnetConnection telnetConnection) -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()voiddestroy()Terminate the processintReturns 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.booleanCheck if the remote process has completed.protected voidintwaitFor()Wait until the process has terminated Note: some implementations (e.g.
-
Constructor Details
-
TelnetCommandShell
-
-
Method Details
-
destroy
public void destroy()Description copied from interface:IRemoteProcessTerminate the process- Specified by:
destroyin interfaceIRemoteProcess
-
exitValue
public int exitValue()Description copied from interface:IRemoteProcessReturns the exit value for the process- Specified by:
exitValuein interfaceIRemoteProcess- Returns:
- the exit value
-
getErrorStream
Description copied from interface:IRemoteProcessGets 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:
getErrorStreamin interfaceIRemoteProcess- Returns:
- the output stream connected to the standard error of the process
-
getInputStream
Description copied from interface:IRemoteProcessGets 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:
getInputStreamin interfaceIRemoteProcess- Returns:
- the input stream connected to the standard output of the process
-
getOutputStream
Description copied from interface:IRemoteProcessGets an output stream which can be used to write to the standard input stream of the process- Specified by:
getOutputStreamin interfaceIRemoteProcess- Returns:
- the output stream connected to the standard input of the process
-
waitFor
Description copied from interface:IRemoteProcessWait 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:
waitForin 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:IRemoteProcessCheck 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:
isCompletedin interfaceIRemoteProcess- Returns:
- true if remote process has completed
-
getRemoteConnection
Description copied from interface:IRemoteProcessGet the connection that is used by this process- Specified by:
getRemoteConnectionin interfaceIRemoteProcess- Returns:
- connection used by this process
-
getService
Description copied from interface:IRemoteProcessGet the service for this remote process that implements the given interface.- Specified by:
getServicein 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:IRemoteProcessDoes this remote process support the given service.- Specified by:
hasServicein interfaceIRemoteProcess- Parameters:
service- The service to be tested- Returns:
- true if this connection supports the service
-
getProcessBuilder
Description copied from interface:IRemoteProcessGet the process builder used to create this process- Specified by:
getProcessBuilderin interfaceIRemoteProcess- Returns:
- process builder used to create this process
-
connect
- Throws:
RemoteConnectionException
-
terminated
protected void terminated()
-