Package org.codehaus.groovy.runtime
Class ProcessGroovyMethods.ProcessRunner
java.lang.Object
org.codehaus.groovy.runtime.ProcessGroovyMethods.ProcessRunner
- All Implemented Interfaces:
Runnable
- Enclosing class:
- ProcessGroovyMethods
A Runnable which waits for a process to complete together with a notification scheme
allowing another thread to wait a maximum number of seconds for the process to complete
before killing it.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()voidwaitForOrKill(long millis) Waits up tomillismilliseconds forrun()to finish.
-
Constructor Details
-
ProcessRunner
Binds this runner toprocess.- Parameters:
process- the processrun()waits for andwaitForOrKill(long)may destroy
-
-
Method Details
-
run
public void run() -
waitForOrKill
public void waitForOrKill(long millis) Waits up tomillismilliseconds forrun()to finish. If the process is still running,Process.destroy()is called and this method waits for the process to exit. An interrupt during the timed wait restores the interrupt status and then still destroys the process when it has not finished.- Parameters:
millis- maximum wait before the process is destroyed, in milliseconds
-