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)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface java.util.concurrent.RejectedExecutionHandler