code: public void shutdown() {
          if (workers == null) {
              if (LOGGER.isLoggable(Level.INFO))
                  LOGGER.info(name + " already been shutdown");
              return;
          }
  
          if (LOGGER.isLoggable(Level.INFO))
              LOGGER.info("Starting shutdown " + name);
  
          for (final Thread worker : workers) {
              worker.interrupt();
              try {
                  worker.join();
              } catch (InterruptedException exception) {
                  Thread.currentThread().interrupt();
              }
          }
          workers = null;
  
          TcpServerHandler handler;
          while ((handler = handlers.poll()) != null) handler.destroy();
          handlers = null;
  
          if (LOGGER.isLoggable(Level.INFO))
              LOGGER.info(name + " was shutdown");
      }
docs: Shutdown connector.
  
  This method wait when all resources will be closed.
  You can call this method any time.
  No problem and exceptions if you try to shutdown connector twice without start.