/* (non-Javadoc)
@see org.openhealthtools.ihe.atna.auditor.queue.AuditMessageQueue#shutdown()
514623
public void shutdown()
	{
		try {
			thread.signalShutdown();
			thread.join();
			thread = null;
		} catch (InterruptedException e) {
			LOGGER.warn("Interrupted while waiting for queue shutdown, may not have completed cleanly", e);
		}
	}
202799
public void shutdown() {
    gossipServiceRunning.set(false);
    gossipThreadExecutor.shutdown();
    if (passiveGossipThread != null) {
      passiveGossipThread.shutdown();
    }
    if (activeGossipThread != null) {
      activeGossipThread.shutdown();
    }
    try {
      boolean result = gossipThreadExecutor.awaitTermination(1000, TimeUnit.MILLISECONDS);
      if (!result) {
        LOGGER.error("executor shutdown timed out");
      }
    } catch (InterruptedException e) {
      LOGGER.error(e);
    }
  }
1058970
final void shutdown() {
        _enabled = false;
        _ignoredSegs.clear();
        
        if(_executor != null && !_executor.isShutdown()) {
            try {
                _executor.shutdown();
                _log.info("shutdown");
            } catch (Exception e) {
                _log.warn("shutdown abort", e);
            }
            
            try {
                _executor.awaitTermination(_shutdownTimeout, TimeUnit.SECONDS);
            } catch (Exception e) {
                _log.warn("shutdown abort", e);
            }
            
            if(_segTarget != null) {
                try {
                    _updateManager.endUpdate(_segTarget);
                } catch (Exception e) {
                    _log.warn("shutdown abort", e);
                }
            }
        }
        
        _executor = null;
        _state = State.DONE;
    }
197194
@Override
    public void stop() {
        if(isStarted.compareAndSet(true,false)){
            healthCheckService.shutdown();
            heartbeatService.shutdown();
        }
    }
684520
@Override
    public void shutdown() {
        synchronized (connections) {
            parent.channelCloses(this);
            for (final MessageInbound connection : connections) {
                try {
                    connection.getWsOutbound().close(0, null);
                } catch (final IOException e) {
                    LOG.error("Connection [" + connection.toString() + "] can't be closed.", e);
                } finally {
                    final ExecutorService executorService = connectionThreads.get(connection);
                    if (executorService != null) {
                        executorService.shutdown();
                    }
                    connectionThreads.remove(connection);
                }
            }
            connections.clear();
        }
        callback = null;
    }
247821
public synchronized static void shutdown() {
        Set<String> protocols = instances.keySet();

        if (protocols.size() > 0) {
            Iterator<String> i = protocols.iterator();

            SyslogUtility.sleep(SyslogConstants.THREAD_LOOP_INTERVAL_DEFAULT);

            while(i.hasNext()) {
                String protocol = i.next();

                SyslogIF syslog = instances.get(protocol);

                syslog.shutdown();
            }

            instances.clear();
        }
    }
1030117
public void shutdown() {
        executorService.shutdown();
        scheduler.shutdown();
        daemonScheduler.shutdown();
        executorServiceSingleThreads.values().forEach(ExecutorService::shutdown);
    }
1095712
public synchronized void shutdown(){

		if (!this.poolShuttingDown){
			logger.info("Shutting down connection pool...");
			this.poolShuttingDown = true;
			this.shutdownStackTrace = captureStackTrace(SHUTDOWN_LOCATION_TRACE);
			this.keepAliveScheduler.shutdownNow(); // stop threads from firing.
			this.maxAliveScheduler.shutdownNow(); // stop threads from firing.
			this.connectionsScheduler.shutdownNow(); // stop threads from firing.
			this.asyncExecutor.shutdownNow();

			try {
				this.connectionsScheduler.awaitTermination(5, TimeUnit.SECONDS);

				this.maxAliveScheduler.awaitTermination(5, TimeUnit.SECONDS);
				this.keepAliveScheduler.awaitTermination(5, TimeUnit.SECONDS);
				this.asyncExecutor.awaitTermination(5, TimeUnit.SECONDS);
				
				if (this.closeConnectionExecutor != null){
					this.closeConnectionExecutor.shutdownNow();
					this.closeConnectionExecutor.awaitTermination(5, TimeUnit.SECONDS);
				}
				
			} catch (InterruptedException e) {
				// do nothing
			}
			this.connectionStrategy.terminateAllConnections();
			unregisterDriver();
			registerUnregisterJMX(false);
			if (finalizableRefQueue != null) {
				finalizableRefQueue.close();
			}
			    logger.info("Connection pool has been shutdown.");
		}
	}
892927
public void shutDown() {

        // we don't want to listen to further events
        OpenCms.getEventManager().removeCmsEventListener(this);
        setReloadScheduled(false);
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                org.opencms.staticexport.Messages.get().getBundle().key(
                    org.opencms.staticexport.Messages.INIT_SHUTDOWN_1,
                    this.getClass().getName()));
        }
    }
465955
@Override
  protected void shutDown()
      throws Exception {
    this.scheduledExecutorPool.shutdown();
    this.scheduledExecutorPool.awaitTermination(TERMINATION_TIMEOUT, TimeUnit.SECONDS);
    this.jobStatusMonitor.shutDown();
  }
710242
public synchronized void shutDown() {

        m_adminCms = null;

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_SHUTDOWN_1, this.getClass().getName()));
        }

        if (m_scheduler != null) {
            try {
                m_scheduler.shutdown();
            } catch (SchedulerException e) {
                LOG.error(Messages.get().getBundle().key(Messages.LOG_SHUTDOWN_ERROR_0));
            }
        }

        m_scheduler = null;
    }
471935
public void shutdown()
    {
        logger.info("Waiting for messaging service to quiesce");
        // We may need to schedule hints on the mutation stage, so it's erroneous to shut down the mutation stage first
        assert !StageManager.getStage(Stage.MUTATION).isShutdown();

        // the important part
        callbacks.shutdownBlocking();

        // attempt to humor tests that try to stop and restart MS
        try
        {
            for (SocketThread th : socketThreads)
                th.close();
        }
        catch (IOException e)
        {
            throw new IOError(e);
        }
    }
1313996
public synchronized void shutdown() {
        if (mState == STATE_STOPPED) {
            return;
        }
        if (mState == STATE_NOT_STARTED) {
            mState = STATE_STOPPED;
            return;
        }
        mState = STATE_SHOULD_STOP;
        // Inject stop task into the queue so it knows to stop, in case we're blocked.
        mQueue.offer(STOP_TASK);
    }
88321
@Override
    public void shutdown() {
        Throwable shutdownException = null;
        try {
            fire(new ManagerStopping());
        } catch (Exception e) {
            try {
                fireException(e);
            } catch (Exception e2) {
                shutdownException = e2;
            }
        }
        synchronized (this) {
            for (Context context : contexts) {
                context.clearAll();
            }
            contexts.clear();
            extensions.clear();

            runtimeLogger.clear();

            handledThrowables.remove();
        }
        if (shutdownException != null) {
            UncheckedThrow.throwUnchecked(shutdownException);
        }
    }
560544
@Override
  public void shutdown() {
    enqueuer =
        new DisruptorEnqueuer() {
          final AtomicBoolean logged = new AtomicBoolean(false);

          @Override
          public void enqueue(Entry entry) {
            if (!logged.getAndSet(true)) {
              logger.log(Level.INFO, "Attempted to enqueue entry after Disruptor shutdown.");
            }
          }
        };

    disruptor.shutdown();
  }
1045866
@Override
  protected void shutDown() throws Exception {
    this.scheduledExecutor.shutdown();
    this.scheduledExecutor.awaitTermination(TERMINATION_TIMEOUT, TimeUnit.SECONDS);
  }
534787
public void shutdown() {
		singleton = null;
		log.info("Shuting down GossipMonger");
		isShutdown.set(true);
		threadPool.shutdown(); // Disable new tasks from being submitted
		// TODO: Wait for messages to end processing
		shutdownAndAwaitTermination(threadPool);
		// Clean ThreadLocal
		ref.remove();
	}