| java.lang.Object org.apache.commons.httpclient.util.TimeoutController
TimeoutController | final public class TimeoutController (Code) | |
Executes a task with a specified timeout.
author: Ortwin Glueck author: Mike Bowler version: $Revision: 480424 $ since: 2.0 |
Inner Class :public static class TimeoutException extends Exception | |
Method Summary | |
public static void | execute(Thread task, long timeout) Executes task . | public static void | execute(Runnable task, long timeout) Executes task in a new deamon Thread and waits for the timeout.
Parameters: task - The task to execute Parameters: timeout - The timeout in milliseconds. |
execute | public static void execute(Thread task, long timeout) throws TimeoutException(Code) | | 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().
Parameters: task - The thread to execute Parameters: timeout - The timeout in milliseconds. 0 means to wait forever. throws: TimeoutException - if the timeout passes and the thread does not return. |
execute | public static void execute(Runnable task, long timeout) throws TimeoutException(Code) | | Executes task in a new deamon Thread and waits for the timeout.
Parameters: task - The task to execute Parameters: timeout - The timeout in milliseconds. 0 means to wait forever. throws: TimeoutException - if the timeout passes and the thread does not return. |
|
|