public static XnioExecutor . Key executeAfter ( XnioIoThread thread , Runnable task , long timeout , TimeUnit timeUnit ) { try { return thread . executeAfter ( task , timeout , timeUnit ) ; } catch ( RejectedExecutionException e ) { if ( thread . getWorker ( ) . isShutdown ( ) ) { UndertowLogger . ROOT_LOGGER . debugf ( e , "Failed to schedule task %s as worker is shutting down" , task ) ; //we just return a bogus key in this case return new XnioExecutor . Key ( ) { @ Override public boolean remove ( ) { return false ; } } ; } else { throw e ; } } }
Schedules a task for future execution . If the execution is rejected because the worker is shutting down then it is logged at debug level and the exception is not re - thrown