Package org.zeroturnaround.process
Class PollingProcess
java.lang.Object
org.zeroturnaround.process.AbstractProcess
org.zeroturnaround.process.PollingProcess
- All Implemented Interfaces:
SystemProcess
- Direct Known Subclasses:
PidProcess
Base implementation that polls for a process status.
waitFor methods poll for SystemProcess.isAlive() method
which should be implemented in the sub classes.
-
Field Summary
Fields inherited from class org.zeroturnaround.process.AbstractProcess
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongvoidsetIntervalForCheckingFinished(long intervalForCheckingFinished) voidwaitFor()Causes the current thread to wait, if necessary, until this process has terminated.Methods inherited from class org.zeroturnaround.process.AbstractProcess
destroy, destroyForcefully, destroyGracefully, getDescription, toString, waitForMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.zeroturnaround.process.SystemProcess
isAlive
-
Constructor Details
-
PollingProcess
public PollingProcess()
-
-
Method Details
-
getIntervalForCheckingFinished
public long getIntervalForCheckingFinished() -
setIntervalForCheckingFinished
public void setIntervalForCheckingFinished(long intervalForCheckingFinished) -
waitFor
Description copied from interface:SystemProcessCauses the current thread to wait, if necessary, until this process has terminated.This method returns immediately if the process has already terminated. If the process has not yet terminated, the calling thread will be blocked until the process exits.
- Throws:
InterruptedException- if interrupted.
-