code: public void stop() {
      running = false;
      if (server != null) server.stop();
      if (aggregateDaemon != null) aggregateDaemon.interrupt();
    }
docs: Stop all Collector threads and wait for all to finish.