code: @PreDestroy
      public void close() {
          synchronized (operationOnConnectionMonitor) {
              if (state == State.CLOSED) {
                  LOGGER.warn("Attempt to close connection factory which is already closed");
                  return;
              }
              LOGGER.info("Closing connection factory");
              if (connection != null) {
                  try {
                      connection.close();
                      connection = null;
                  } catch (IOException e) {
                      if (! connection.isOpen()) {
                          LOGGER.warn("Attempt to close an already closed connection");
                      } else {
                          LOGGER.error("Unable to close current connection", e);
                      }
                  }
              }
              changeState(State.CLOSED);
              LOGGER.info("Closed connection factory");
          }
      }
docs: <p>Closes the connection factory and interrupts all
  threads associated to it.</p>
  
  <p>Note: Make sure to close the connection
  factory when not used any more as otherwise the connection
  may remain established and ghost threads may reside.</p>