public CompletableFuture < Void > close ( ) { CompletableFuture [ ] futures = new CompletableFuture [ connections . size ( ) ] ; for ( CompletableFuture < Connection > future : this . connectionFutures . values ( ) ) { future . cancel ( false ) ; } int i = 0 ; for ( Connection connection : connections . values ( ) ) { futures [ i ++ ] = connection . close ( ) ; } return CompletableFuture . allOf ( futures ) ; }
Closes the connection manager .