code: public void shutdown() {
          for (Connection connection : _connectionMap.values()) {
              connection.shutdown();
          }
  
          for (Connection connection : _privilegedConnectionMap.values()) {
              connection.shutdown();
          }
  
          _factory.releaseExternalResources();
      }
docs: Called when the application is being shut down.