public CompletableThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> queue) { super(corePoolSize, maximumPoolSize, keepAliveTime, unit, queue, new CompletableRejectedExecutionHandler()); // now that super() has been called we can reference "this" to add it to // the RejectedExecutionHandler ((CompletableRejectedExecutionHandler) getRejectedExecutionHandler()).setThreadPool(this); }