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 ClassesModifier and TypeInterfaceDescriptionstatic interface
The interface that is extend by services provided for this remote connection. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.int
waitFor()
Wait until the process has terminated Note: some implementations (e.g.
-
Method Details
-
destroy
void destroy()Terminate the process -
exitValue
int exitValue()Returns the exit value for the process- Returns:
- the exit value
-
getErrorStream
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
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
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
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
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
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:
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
-