public interface CommandHandle extends Remote
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Forfully terminates the command.
|
int |
exitValue()
Obtains the exit value of the command.
|
byte[] |
fetchOutput(int streamId)
Obtains the stdout or stderr of the command.
|
FileTransfer |
fetchOutput(int streamId,
String destFile)
Obtains the stdout or stderr of the command and put it into file.
|
String |
getCommandString()
Obtains the command string this command handle represents.
|
void |
waitFor()
Waits for the command to terminate.
|
void |
waitFor(int timeout)
Waits for the command to terminate, with a given timeout.
|
String getCommandString() throws RemoteException
RemoteException
- A network error occurredvoid destroy() throws RemoteException
RemoteException
- A network error occurredvoid waitFor() throws InterruptedException, RemoteException
InterruptedException
- The waiting thread got interruptedRemoteException
- A network error occurredvoid waitFor(int timeout) throws InterruptedException, RemoteException
timeout
- The time outInterruptedException
- The waiting thread got interrupted.RemoteException
int exitValue() throws IllegalStateException, RemoteException
IllegalStateException
- If the command has not yet terminatedRemoteException
- A network error occurredbyte[] fetchOutput(int streamId) throws IOException, IllegalStateException, RemoteException
streamId
- Command.STDOUT or Command.STDERRIOException
- There is an error getting the outputIllegalStateException
- The command is not yet terminated or
does not record outputRemoteException
- A network error occurredFileTransfer fetchOutput(int streamId, String destFile) throws IOException, IllegalStateException, RemoteException
streamId
- Command.STDOUT or Command.STDERRdestFile
- The destination file on the calling systemIOException
- There is an error getting the outputIllegalStateException
- The command is not yet terminated or
does not record outputRemoteException
- A network error occurred