shutdown the AnnisService - ensure that current work load finishes
321629
public void shutdown()
  {
    log.info("Shutting down...");
    isShutdownRequested = true;

    try
    {
      mainThread.join();
    }
    catch (InterruptedException e)
    {
      log.error(
        "Interrupted which waiting on main daemon thread to complete.");
    }
  }
855603
def shutdown(self):
        
        if self.configWindow is not None:
            if self.configWindow.promptToSave():
                return

            self.configWindow.hide()

        self.notifier.hide_icon()

        t = threading.Thread(target=self.__completeShutdown)
        t.start()
1373389
@Override
    public void shutdown() {
        try {
            verifyMaintainability();
        } catch (VerificationFailedException ex) {
            throw new RuntimeException("Can not shutdown " + this + "!", ex);
        }

        this.shutdownInitiated = true;
        try {
            dataObservable.shutdown();
        } finally {
            try {
                deactivate();
            } catch (CouldNotPerformException | InterruptedException ex) {
                ExceptionPrinter.printHistory("Could not shutdown " + this + "!", ex, logger);
            }
        }
    }
766798
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");
    }
590244
public void shutdown() {
    this.flowTriggerExecutorService.shutdown();
    this.cancelExecutorService.shutdown();
    this.timeoutService.shutdown();

    this.flowTriggerExecutorService.shutdownNow();
    this.cancelExecutorService.shutdownNow();
    this.timeoutService.shutdownNow();

    this.triggerProcessor.shutdown();
    this.triggerPluginManager.shutdown();
    this.cleaner.shutdown();
  }
647849
def shutdown(self):
        
        logging.info("Shutting down")
        self.closeAllWindows()
        self.notifier.hide()
        self.service.shutdown()
        self.monitor.stop()
        self.quit()
        os.remove(common.LOCK_FILE)  # TODO: maybe use atexit to remove the lock/pid file?
        logging.debug("All shutdown tasks complete... quitting")
639303
public static void shutdown() {
        if (MetricsManager.executorService != null) {
            MetricsManager.executorService.shutdown();
            MetricsManager.executorService = null;
        }
        if (MetricsManager.instance != null) {
            MetricsManager.instance = null;
            MetricsManager.poolManager.shutdown();
            MetricsManager.poolManager = null;
            MetricsManager.httpClient = null;
            MetricsManager.rootMetricsLogger = null;
        }
    }
845906
public void stop() {
    if (mBackup != null) {
      mBackup.cancel(true);
      mBackup = null;
    }
    LOG.info("Daily metadata backup stopped");

    mScheduledExecutor.shutdownNow();
    String waitForMessage = "waiting for daily metadata backup executor service to shut down";
    try {
      if (!mScheduledExecutor.awaitTermination(SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS)) {
        LOG.warn("Timed out " + waitForMessage);
      }
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      LOG.warn("Interrupted while " + waitForMessage);
    }
  }
1327885
public final synchronized void shutdown() {  // synchronize on 'this' to avoid races with registerStreams
        stopped = true;
        // If the cleanup task is running tell it to stop looping, and then remove it from the scheduled executor
        if (cleanupTaskFuture != null) {
            cleanupTaskFuture.cancel(false);
        }

        // Close remaining streams
        for (Map.Entry<InputStreamKey, TimedStreamEntry> entry : streamMap.entrySet()) {
            InputStreamKey key = entry.getKey();
            TimedStreamEntry timedStreamEntry = entry.getValue();
            //noinspection SynchronizationOnLocalVariableOrMethodParameter
            synchronized (timedStreamEntry) { // ensure there's no race with a request that got a ref before we removed it
                closeStreamEntry(timedStreamEntry, key.requestId, key.index);
            }
        }
    }
766109
public void shutdown() {
        buffer.clear();


        if (thread != null)
            thread.interrupt();
        try {
            // Shutdown() should be a synchronous operation since the iterator is reset after shutdown() is
            // called in AsyncLabelAwareIterator.reset().
            if (thread != null)
                thread.join();
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RuntimeException(e);
        }
        thread.shutdown();
        buffer.clear();
    }
125294
def do_shutdown (self):
        """"""
        with self.mutex:
            unfinished = self.unfinished_tasks - len(self.queue)
            self.queue.clear()
            if unfinished <= 0:
                if unfinished < 0:
                    raise ValueError('shutdown is in error')
                self.all_tasks_done.notifyAll()
            self.unfinished_tasks = unfinished
            self.shutdown = True
1030117
public void shutdown() {
        executorService.shutdown();
        scheduler.shutdown();
        daemonScheduler.shutdown();
        executorServiceSingleThreads.values().forEach(ExecutorService::shutdown);
    }
680857
public void shutdown() {
        logger.info("Closing Retrieval Manager");
        workerPool.shutdown();

        try {
            workerPool.awaitTermination(30, TimeUnit.MINUTES);
        } catch (InterruptedException e) {
            // Exit wait on interruption
        }

        complete = true;
    }
699664
def stop(self):
        
        if self.is_run:
            self._service.shutdown()
            self._service.server_close()
472235
def shutdown(self, service_thread_map):
    """"""
    with self._services.lifecycle_lock:
      for service, service_thread in service_thread_map.items():
        self._logger.info('terminating pantsd service: {}'.format(service))
        service.terminate()
        service_thread.join(self.JOIN_TIMEOUT_SECONDS)
      self._logger.info('terminating pantsd')
      self._kill_switch.set()
183097
public void shutdown() {
    this.shouldRun = false;
    this.namespaceSliceDUMap.clear();
    if(this.refreshUsed != null) {
      this.refreshUsed.interrupt();
      try {
        this.refreshUsed.join();
        this.refreshUsed = null;
      } catch (InterruptedException ie) {
      }
    }
  }
1254294
public static void shutdownAndAwaitTermination() {
		shutdown();
		if (pool != null) {
			try {
				// wait a while for existing tasks to terminate
				if (!pool.awaitTermination(60L, TimeUnit.SECONDS)) {
					pool.shutdownNow(); // cancel currently executing tasks
					// wait a while for tasks to respond to being canceled
					if (!pool.awaitTermination(60L, TimeUnit.SECONDS)) {
						logger.warn("BioJava ConcurrencyTools thread pool did not terminate");
					}
				}
			} catch (InterruptedException ie) {
				pool.shutdownNow(); // (re-)cancel if current thread also interrupted
				Thread.currentThread().interrupt(); // preserve interrupt status
			}
		}
	}