Class CallerBlocksPolicy
java.lang.Object
org.springframework.integration.util.CallerBlocksPolicy
- All Implemented Interfaces:
java.util.concurrent.RejectedExecutionHandler
public class CallerBlocksPolicy
extends java.lang.Object
implements java.util.concurrent.RejectedExecutionHandler
A
RejectedExecutionHandler
that blocks the caller until
the executor has room in its queue, or a timeout occurs (in which
case a RejectedExecutionException
is thrown.- Since:
- 3.0.3
-
Constructor Summary
Constructors Constructor Description CallerBlocksPolicy(long maxWait)
Construct instance based on the provided maximum wait time. -
Method Summary
Modifier and Type Method Description void
rejectedExecution(java.lang.Runnable r, java.util.concurrent.ThreadPoolExecutor executor)
-
Constructor Details
-
CallerBlocksPolicy
public CallerBlocksPolicy(long maxWait)Construct instance based on the provided maximum wait time.- Parameters:
maxWait
- The maximum time to wait for a queue slot to be available, in milliseconds.
-
-
Method Details
-
rejectedExecution
public void rejectedExecution(java.lang.Runnable r, java.util.concurrent.ThreadPoolExecutor executor)- Specified by:
rejectedExecution
in interfacejava.util.concurrent.RejectedExecutionHandler
-