Class Scheduler.ShutdownHandler

  • All Implemented Interfaces:
    java.util.concurrent.RejectedExecutionHandler
    Enclosing class:
    Scheduler

    public class Scheduler.ShutdownHandler
    extends java.lang.Object
    implements java.util.concurrent.RejectedExecutionHandler
    There is a way to shutdown the hierarchy of schedulers. You can do it in master scheduler via Scheduler.shutdownThreadPoolsAwaitingKilled() which kills the current master and children recursively. If alternatively a shared ExecutorService used by the master and children schedulers is shutdown from outside, then the Scheduler.ShutdownHandler is a hook calling current Scheduler.describeStopped(boolean). The method Scheduler.describeStopped(boolean) is again shutting down children schedulers recursively as well.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.RejectedExecutionHandler poolHandler  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ShutdownHandler()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void rejectedExecution​(java.lang.Runnable r, java.util.concurrent.ThreadPoolExecutor executor)  
      void setRejectedExecutionHandler​(java.util.concurrent.RejectedExecutionHandler poolHandler)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • poolHandler

        private volatile java.util.concurrent.RejectedExecutionHandler poolHandler
    • Constructor Detail

      • ShutdownHandler

        protected ShutdownHandler()
    • Method Detail

      • setRejectedExecutionHandler

        public void setRejectedExecutionHandler​(java.util.concurrent.RejectedExecutionHandler poolHandler)
      • rejectedExecution

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