private void shutdownManagedChannel ( ChannelKey channelKey , long shutdownTimeoutMs ) { ManagedChannel managedChannel = mChannels . get ( channelKey ) . get ( ) ; managedChannel . shutdown ( ) ; try { managedChannel . awaitTermination ( shutdownTimeoutMs , TimeUnit . MILLISECONDS ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; // Allow thread to exit. } finally { managedChannel . shutdownNow ( ) ; } Verify . verify ( managedChannel . isShutdown ( ) ) ; LOG . debug ( "Shut down managed channel. ChannelKey: {}" , channelKey ) ; }
Shuts down the managed channel for given key .