|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.faban.common.CommandHandleImpl
public class CommandHandleImpl
Implementation of the remote command handle.
Method Summary | |
---|---|
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. |
void |
waitMatch()
Waits for the command until it matches a certain string it its output streams. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public String getCommandString()
getCommandString
in interface CommandHandle
public void destroy()
destroy
in interface CommandHandle
public void waitFor() throws InterruptedException
waitFor
in interface CommandHandle
InterruptedException
- The waiting thread got interruptedpublic void waitFor(int timeout) throws InterruptedException
waitFor
in interface CommandHandle
timeout
- The time out
InterruptedException
- The waiting thread got interrupted.public int exitValue()
exitValue
in interface CommandHandle
public byte[] fetchOutput(int streamId) throws IOException
fetchOutput
in interface CommandHandle
streamId
- Command.STDOUT or Command.STDERR
IOException
- There is an error getting the outputpublic FileTransfer fetchOutput(int streamId, String destFile) throws IOException, IllegalStateException
fetchOutput
in interface CommandHandle
streamId
- Command.STDOUT or Command.STDERRdestFile
- The destination file on the calling system
IOException
- There is an error getting the output
IllegalStateException
- The command is not yet terminated or
does not record output
RemoteException
- A network error occurredpublic void waitMatch() throws InterruptedException
InterruptedException
- The wait was interrupted
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |