Save This Page
Home » commons-httpclient-3.1-src » org.apache.commons » httpclient » util » [javadoc | source]
org.apache.commons.httpclient.util
public final class: TimeoutController [javadoc | source]
java.lang.Object
   org.apache.commons.httpclient.util.TimeoutController

Executes a task with a specified timeout.

Nested Class Summary:
public static class  TimeoutController.TimeoutException  Signals that the task timed out. 
Method from org.apache.commons.httpclient.util.TimeoutController Summary:
execute,   execute
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.httpclient.util.TimeoutController Detail:
 public static  void execute(Thread task,
    long timeout) throws TimeoutController.TimeoutException 
    Executes task. Waits for timeout milliseconds for the task to end and returns. If the task does not return in time, the thread is interrupted and an Exception is thrown. The caller should override the Thread.interrupt() method to something that quickly makes the thread die or use Thread.isInterrupted().
 public static  void execute(Runnable task,
    long timeout) throws TimeoutController.TimeoutException 
    Executes task in a new deamon Thread and waits for the timeout.