Class TimeoutController
- java.lang.Object
-
- org.apache.commons.httpclient.util.TimeoutController
-
@Deprecated public final class TimeoutController extends java.lang.Object
Deprecated.Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project. It is not recommended to use it in any new code. Instead, use HTTP client API plugins as a dependency in your code. E.g. Apache HttpComponents Client API 4.x Plugin or Async HTTP Client Plugin.Executes a task with a specified timeout.
- Since:
- 2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimeoutController.TimeoutException
Deprecated.Signals that the task timed out.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
execute(java.lang.Runnable task, long timeout)
Deprecated.Executestask
in a new deamon Thread and waits for the timeout.static void
execute(java.lang.Thread task, long timeout)
Deprecated.Executestask
.
-
-
-
Method Detail
-
execute
public static void execute(java.lang.Thread task, long timeout) throws TimeoutController.TimeoutException
Deprecated.Executestask
. Waits fortimeout
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 executetimeout
- The timeout in milliseconds. 0 means to wait forever.- Throws:
TimeoutController.TimeoutException
- if the timeout passes and the thread does not return.
-
execute
public static void execute(java.lang.Runnable task, long timeout) throws TimeoutController.TimeoutException
Deprecated.Executestask
in a new deamon Thread and waits for the timeout.- Parameters:
task
- The task to executetimeout
- The timeout in milliseconds. 0 means to wait forever.- Throws:
TimeoutController.TimeoutException
- if the timeout passes and the thread does not return.
-
-