Class CallerRunsRejectOnShutdownPolicy

  • All Implemented Interfaces:
    java.util.concurrent.RejectedExecutionHandler

    public class CallerRunsRejectOnShutdownPolicy
    extends java.util.concurrent.ThreadPoolExecutor.AbortPolicy
    A handler for rejected tasks that runs the rejected task directly in the calling thread of the execute method. If the executor was shutdown, it will instead throw a RejectedExecutionException.
    Since:
    10.0
    Author:
    wburns
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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 Detail

      • CallerRunsRejectOnShutdownPolicy

        public CallerRunsRejectOnShutdownPolicy()
    • Method Detail

      • rejectedExecution

        public void rejectedExecution​(java.lang.Runnable r,
                                      java.util.concurrent.ThreadPoolExecutor executor)
        Specified by:
        rejectedExecution in interface java.util.concurrent.RejectedExecutionHandler
        Overrides:
        rejectedExecution in class java.util.concurrent.ThreadPoolExecutor.AbortPolicy