public void shutdown ( ) { asyncExecutorService . shutdown ( ) ; // Disable new health checks from being submitted try { // Give some time to the current healtch checks to finish gracefully if ( ! asyncExecutorService . awaitTermination ( 1 , TimeUnit . SECONDS ) ) { asyncExecutorService . shutdownNow ( ) ; } } catch ( InterruptedException ie ) { asyncExecutorService . shutdownNow ( ) ; Thread . currentThread ( ) . interrupt ( ) ; } }
Shuts down the scheduled executor for async health checks