public Future < Void > close ( ) { return this . allChannels . close ( ) . addListener ( new GenericFutureListener < Future < Void > > ( ) { @ Override public void operationComplete ( final Future < Void > future ) throws Exception { ApnsChannelPool . this . isClosed = true ; if ( ApnsChannelPool . this . channelFactory instanceof Closeable ) { ( ( Closeable ) ApnsChannelPool . this . channelFactory ) . close ( ) ; } for ( final Promise < Channel > acquisitionPromise : ApnsChannelPool . this . pendingAcquisitionPromises ) { acquisitionPromise . tryFailure ( POOL_CLOSED_EXCEPTION ) ; } } } ) ; }
Shuts down this channel pool and releases all retained resources .