org.zeroturnaround.process
Class PollingProcess

java.lang.Object
  extended by org.zeroturnaround.process.AbstractProcess
      extended by 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.


Field Summary
 
Fields inherited from class org.zeroturnaround.process.AbstractProcess
log
 
Constructor Summary
PollingProcess()
           
 
Method Summary
 long getIntervalForCheckingFinished()
           
 void setIntervalForCheckingFinished(long intervalForCheckingFinished)
           
 void waitFor()
          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, waitFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zeroturnaround.process.SystemProcess
isAlive
 

Constructor Detail

PollingProcess

public PollingProcess()
Method Detail

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


Copyright © 2015 ZeroTurnaround. All rights reserved.