Stop the job leader services. This implies stopping all leader retrieval services for the
different jobs and their leader retrieval listeners.

@throws Exception if an error occurs while stopping the service
519846
public void stop() throws Exception {
		LOG.info("Stop job leader service.");

		if (JobLeaderService.State.STARTED == state) {

			for (Tuple2<LeaderRetrievalService, JobLeaderService.JobManagerLeaderListener> leaderRetrievalServiceEntry: jobLeaderServices.values()) {
				LeaderRetrievalService leaderRetrievalService = leaderRetrievalServiceEntry.f0;
				JobLeaderService.JobManagerLeaderListener jobManagerLeaderListener = leaderRetrievalServiceEntry.f1;

				jobManagerLeaderListener.stop();
				leaderRetrievalService.stop();
			}

			jobLeaderServices.clear();
		}

		state = JobLeaderService.State.STOPPED;
	}
876905
@Override
  public void stop() {
    logger().log("Server stopping...");

    failTimedOutMissingContentRequests();

    channel.stop();
    channel.close();

    for (final Dispatcher dispatcher : dispatcherPool) {
      dispatcher.stop();
    }

    logger().log("Server stopped.");

    super.stop();
  }
373757
public void stop(BundleContext context) throws Exception {
        ClassServiceUtility.log(context, LogService.LOG_INFO, "Stopping " + this.getClass().getName() + " Bundle");
    	if (this.shutdownService(service, context))
    		service = null;
        // Unregisters automatically
        this.context = null;
    }
576627
public void stop() throws Exception {
    // close all connectors and release all binding ports
    for (Connector connector : mServer.getConnectors()) {
      connector.stop();
    }

    mServer.stop();
  }
98333
public ServiceBroker stop() {

		// Stop internal components
		stop(transporter);
		stop(serviceRegistry);
		stop(eventbus);
		stop(serviceInvoker);
		stop(contextFactory);
		stop(strategyFactory);
		stop(uidGenerator);

		// Shutdown thread pools
		if (config.isShutDownThreadPools()) {
			ExecutorService executor = config.getExecutor();
			if (executor != null && !executor.isShutdown() && !executor.isTerminated()) {
				try {
					executor.shutdownNow();
				} catch (Exception ignored) {
				}
			}
			logger.info("Task Executor Service stopped.");
			ScheduledExecutorService scheduler = config.getScheduler();
			if (scheduler != null && !scheduler.isShutdown() && !scheduler.isTerminated()) {
				try {
					scheduler.shutdownNow();
				} catch (Exception ignored) {
				}
			}
			logger.info("Task Scheduler Service stopped.");
		}
		return this;
	}
651482
@Override
    protected void stopInner() throws VoldemortException {
        List<VoldemortException> exceptions = new ArrayList<VoldemortException>();

        logger.info("Stopping services:" + getIdentityNode().getId());
        /* Stop in reverse order */
        exceptions.addAll(stopOnlineServices());
        for(VoldemortService service: Utils.reversed(basicServices)) {
            try {
                service.stop();
            } catch(VoldemortException e) {
                exceptions.add(e);
                logger.error(e);
            }
        }
        logger.info("All services stopped for Node:" + getIdentityNode().getId());

        if(exceptions.size() > 0)
            throw exceptions.get(0);
        // release lock of jvm heap
        JNAUtils.tryMunlockall();
    }
1003015
protected void stopAllActiveJobs() {

        for (Long jobExecutionId : executingJobs.keySet()) {
            try {
                logger.log(Level.INFO, "stopping.job.at.shutdown", jobExecutionId);
                stopJob(jobExecutionId);
            } catch (Exception e) {
                // FFDC it.  Could be the job just finished.  In any event,
                // continue on and stop the remaining jobs.
            }
        }
    }
737582
@Override
    public void stop(){
        if(isStarted){
            synchronized (this) {
                if (isStarted) {
                    if (getLookupService() instanceof Closable) {
                        ((Closable) getLookupService()).stop();
                    }
                    isStarted = false;
                }
            }
        }
    }
968749
public static synchronized void shutdown() {
		if (LOG_APPENDER != null) {
			try {
				LOG_APPENDER.close();
			} catch (Throwable t) {
				LOGGER.error("Exception stopping Stackify Log API service", t);
			}
		}
	}
208816
@Override
	public void stop() {
		if (state.stop()){
			try{
				doStop();
				state.finishStopping();
			}catch(Exception e){
				state.failStopping();
				logger.warn("Failed to stop {}", this.getClass().getName(), e);
			}
		}

	}
167880
@Override
  public void terminate() {
    // disable ability to request for restart
    restartRequested.set(false);
    restartDisabled.set(true);

    if (nodeLifecycle.tryToMoveTo(NodeLifecycle.State.STOPPING)) {
      LOG.info("Stopping SonarQube");
    }
    stopAll();
    if (stopperThread != null) {
      stopperThread.interrupt();
    }
    if (restarterThread != null) {
      restarterThread.interrupt();
    }
    keepAlive.countDown();
  }
30263
@PreDestroy
    public void stop() throws Exception {
        JmxUtils2.unregisterObject(queryMbeanObjectName, embeddedJmxTrans.getMbeanServer());

        for (OutputWriter outputWriter : outputWriters) {
            outputWriter.stop();
        }
    }
540598
@Override
    public void stop() {
        synchronized (this.lifecycleMonitor) {
            if (isRunning()) {
                log.info("stop: Stopping ConnectorManager");
                try {
                    connector.stop();
                } finally {
                    running = false;
                }
            }
        }
    }
240306
public boolean stop()
    throws Exception
  {
    /*
    if (_clusterServerPublisher != null) {
      _clusterServerPublisher.onServerStop(_selfServer.getServerBartender());
    }
    */
    
    try {
      if (_portPublic != null) {
        _portPublic.close();
      }
    } catch (Throwable e) {
      log.log(Level.WARNING, e.toString(), e);
    }
    
    try {
      if (_portBartender != null) {
        _portBartender.close();
      }
    } catch (Throwable e) {
      log.log(Level.WARNING, e.toString(), e);
    }
    
    return true;
  }
88273
@Override
    public void stop() {
        // Run jersey shutdown lifecycle
        if (container != null) {
            container.stop();
            container = null;
        }
        // Destroy the jersey service locator
        if (jerseyHandler != null && jerseyHandler.getDelegate() != null) {
            ServiceLocatorFactory.getInstance().destroy(jerseyHandler.getDelegate().getServiceLocator());
            jerseyHandler = null;
        }
        if (server != null) {
            server.close();
            server = null;
        }
    }
525081
@Override
    @FFDCIgnore(JobExecutionNotRunningException.class)
    public void stop() {

        StopLock stopLock = getStopLock(); // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse
        synchronized (stopLock) {

            if (isStepStartingOrStarted()) {
                updateStepBatchStatus(BatchStatus.STOPPING);

                // It's possible we may try to stop a partitioned step before any
                // sub steps have been started.

                // Note: in multi-jvm mode parallelBatchWorkUnits will be empty (sub-jobs may not be
                //       running locally, so no easy way to stop them).
                //       TODO: could queue stopPartition thru JMS i suppose...).
                for (BatchPartitionWorkUnit subJob : parallelBatchWorkUnits) {
                    try {
                        getBatchKernelService().stopWorkUnit(subJob);
                    } catch (JobExecutionNotRunningException e) {
                        logger.fine("Caught exception trying to stop work unit: " + subJob + ", which was not running.");
                        // We want to stop all running sub steps.
                        // We do not want to throw an exception if a sub step has already been completed.
                    } catch (Exception e) {
                        // Blow up if it happens to force the issue.
                        throw new IllegalStateException(e);
                    }
                }
            } else {
                // Might not be set up yet to have a state.
                logger.fine("Ignoring stop, since step not in a state which has a valid status (might not be far enough along to have a state yet)");
            }
        }
    }
1232651
public void start() throws Exception {
		try {
			leaderElectionService.start(this);
		} catch (Exception e) {
			log.error("Could not start the JobManager because the leader election service did not start.", e);
			throw new Exception("Could not start the leader election service.", e);
		}
	}