|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.fisheye.plugins.scm.utils.process.ExternalProcess
public class ExternalProcess
This class manages the execution of an external process, using separate threads to process the process' IO requirements.
Constructor Summary | |
---|---|
ExternalProcess(java.util.List<java.lang.String> command,
ProcessHandler handler)
Process an external command (the command and arguments are given as a list) |
|
ExternalProcess(java.lang.String[] cmdArray,
ProcessHandler handler)
Process an external command. |
|
ExternalProcess(java.lang.String commandLine,
ProcessHandler handler)
Process an external command. |
Method Summary | |
---|---|
void |
cancel()
Cancel should be called if you wish to interrupt process execution. |
void |
execute()
Execute the external command. |
void |
executeWhile(java.lang.Runnable runnable)
Executes the external command. |
void |
finish()
Finish process execution. |
boolean |
finish(int maxWait)
Wait a given time for the process to finish |
java.lang.String |
getCommandLine()
|
ProcessHandler |
getHandler()
Get the process handler for this process execution |
long |
getTimeoutTime()
|
boolean |
isTimedOut()
|
void |
resetWatchdog()
|
void |
setEnvironment(java.lang.String[] environment)
|
void |
setTimeout(long timeout)
|
void |
setWorkingDir(java.io.File workingDir)
|
void |
start()
Start the external process and setup the IO pump threads needed to manage the process IO. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExternalProcess(java.lang.String[] cmdArray, ProcessHandler handler)
cmdArray
- the command and its arguments as separate elementshandler
- The handler for this execution. The handler supports the required IO
operationspublic ExternalProcess(java.util.List<java.lang.String> command, ProcessHandler handler)
command
- A list containing the command and its argumentshandler
- The process handler to manage the execution of this process.public ExternalProcess(java.lang.String commandLine, ProcessHandler handler)
commandLine
- the command and its arguments in a single line. If any arguments
need to contain spaces, the array or list based constructors should be used.handler
- The handler for this execution. The handler supports the required IO
operationsMethod Detail |
---|
public void resetWatchdog()
resetWatchdog
in interface Watchdog
public long getTimeoutTime()
public boolean isTimedOut()
public void setWorkingDir(java.io.File workingDir)
public void setEnvironment(java.lang.String[] environment)
public ProcessHandler getHandler()
public void start()
public void finish()
public void execute()
public void executeWhile(java.lang.Runnable runnable)
runnable
- A task to perform while the external command is running.public java.lang.String getCommandLine()
public boolean finish(int maxWait)
maxWait
- the maximum amount of time in milliseconds to wait for the process to finish
public void cancel()
cancel
in interface Watchdog
public void setTimeout(long timeout)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |