Class PollingProcess

java.lang.Object
org.zeroturnaround.process.AbstractProcess
org.zeroturnaround.process.PollingProcess
All Implemented Interfaces:
SystemProcess
Direct Known Subclasses:
PidProcess

public abstract class PollingProcess extends AbstractProcess
Base implementation that polls for a process status.

waitFor methods poll for SystemProcess.isAlive() method which should be implemented in the sub classes.

  • Constructor Details

    • PollingProcess

      public PollingProcess()
  • Method Details

    • getIntervalForCheckingFinished

      public long getIntervalForCheckingFinished()
    • setIntervalForCheckingFinished

      public void setIntervalForCheckingFinished(long intervalForCheckingFinished)
    • waitFor

      public void waitFor() throws InterruptedException
      Description copied from interface: SystemProcess
      Causes 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.