private void destroyPingExecutor ( ) { synchronized ( pingExecutor ) { if ( ! pingExecutor . isShutdown ( ) ) { try { log . debugf ( "Shutting down WebSocket ping executor" ) ; pingExecutor . shutdown ( ) ; if ( ! pingExecutor . awaitTermination ( 1 , TimeUnit . SECONDS ) ) { pingExecutor . shutdownNow ( ) ; } } catch ( Throwable t ) { log . warnf ( "Cannot shut down WebSocket ping executor. Cause=%s" , t . toString ( ) ) ; } } } }
Call this when you know the feed comm processor object will never be used again and thus the ping executor will also never be used again .