Stops the service collection and releases resources.

@see AbstractLifecycle#onStop
488045
@Override
    protected void onStop()
    {
        if( m_serviceCollection != null )
        {
            m_serviceCollection.stop();
            m_serviceCollection = null;
        }
        setService( null );
    }
190716
public void stop() {
    running = false;
    if (server != null) server.stop();
    if (aggregateDaemon != null) aggregateDaemon.interrupt();
  }
373879
public synchronized void stop() {
        if (isRunning()) {
            socket.get().close();
            socket.set(null);
            deliverLifecycleAnnouncement(logger, false);
        }
    }
1208805
void shutdown() throws InterruptedException {
        m_shouldStop = true;
        if (m_thread != null) {
            m_selector.wakeup();
            m_thread.join();
        }
    }
878203
@Override
	public CompletableFuture<Void> onStop() {
		log.info("Stopping TaskExecutor {}.", getAddress());

		Throwable throwable = null;

		if (resourceManagerConnection != null) {
			resourceManagerConnection.close();
		}

		for (JobManagerConnection jobManagerConnection : jobManagerConnections.values()) {
			try {
				disassociateFromJobManager(jobManagerConnection, new FlinkException("The TaskExecutor is shutting down."));
			} catch (Throwable t) {
				throwable = ExceptionUtils.firstOrSuppressed(t, throwable);
			}
		}

		jobManagerHeartbeatManager.stop();

		resourceManagerHeartbeatManager.stop();

		try {
			stopTaskExecutorServices();
		} catch (Exception e) {
			throwable = ExceptionUtils.firstOrSuppressed(e, throwable);
		}

		if (throwable != null) {
			return FutureUtils.completedExceptionally(new FlinkException("Error while shutting the TaskExecutor down.", throwable));
		} else {
			log.info("Stopped TaskExecutor {}.", getAddress());
			return CompletableFuture.completedFuture(null);
		}
	}
383939
def stop(self, ignore_state=False):
        """"""
        self.logger.debug("Stop service")
        self._toggle_running(False, ignore_state)
66380
@Override
  public synchronized void stop() {
    if (state == STATE.STOPPED ||
        state == STATE.INITED ||
        state == STATE.NOTINITED) {
      // already stopped, or else it was never
      // started (eg another service failing canceled startup)
      return;
    }
    ensureCurrentState(STATE.STARTED);
    changeState(STATE.STOPPED);
    LOG.info("Service:" + getName() + " is stopped.");
  }
1161470
public synchronized void stop() {
        if (!started) {
            return;
        }
        try {
            if (future != null) {
                future.cancel(true);
                future = null;
            }
            if (scheduledExecutorService != null) {
                scheduledExecutorService.shutdownNow();
                scheduledExecutorService = null;
            }
        } catch (Throwable t) {
            LOGGER.warn(t.getMessage(), t);
        } finally {
            SCHEDULED_SERVICE_MAP.remove(this);
            started = false;
        }
    }
179503
@Override
    public synchronized void stop() {
        Preconditions.checkNotNull(getServer());
        if (getServer().isRunning()) {
            try {
                log.info("Stopping...");
                getServer().stop();
                log.info("STOPPED.");
            } catch (Exception e) {
                Throwable t = Throwables.getRootCause(e);
                log.error("Fathom failed on shutdown!", t);
            }
        }
    }
269246
public static void stop(String args[]) {
        log.debug("windowsStop called");
        boot.stop();

        synchronized (SERVICE) {
            // notify the thread synchronized on SERVER in start()
            SERVICE.notify();
        }
    }
1044507
public static synchronized void shutdown() {
		if (BACKGROUND_SERVICE != null) {
			try {
				BACKGROUND_SERVICE.stop();
			} catch (Throwable t) {
				LOGGER.error("Exception stopping Stackify Metrics API service", t);
			}
			
			INITIALIZED.compareAndSet(true, false);
		}
	}
814658
@Override
	public void stop() throws LifecycleException {
    	super.stop();

        /*
         * Service should be stopped and removed otherwise in between start/stop/start of the container,
         * javax.management.InstanceAlreadyExistsException: mss-tomcat-embedded-6:type=SipApplicationDispatcher
         * exception will occur, which is related to the JMX MBeanServer, when tomcat embedded tries to register the MBean, the 
         * instance is already there.
         */
        
		if(service != null) {			
			try {
				service.stop();
				service.destroy();
			} catch (LifecycleException e) {
				log.error("service already stopped ", e);
			}		
			/*
			 * Issue: http://code.google.com/p/mobicents/issues/detail?id=3116
			 * 
			 * We need to force SipFactory to create a new SipStack each time it is asked. By default SipFactory will return the previously 
			 * created SipStack if it exists. This will create a problem in a scenario like:
			 * 
			 * 1. container starts -> SipFactory creates sipStack
			 * 2. System.setProperties such as as properties related to SSL
			 * 3. container.restart -> SipFactory returns previously created SipStack that is not aware of the new System properties
			 * 
			 * Thats why the SipFactory needs to be reset in order to create a new SipStack every time the 
			 * SipFactory.getInstance().createSipFactory (SipStandardService.initialize()) method is called.  
			 */
			SipFactory.getInstance().resetFactory();
		}

    }
714040
public synchronized void stop() {
        if (isRunning()) {
            try {
                setSendingStatus(false);
            } catch (Throwable t) {
                logger.error("Problem stopping sending status during shutdown", t);
            }
            DeviceFinder.getInstance().removeIgnoredAddress(socket.get().getLocalAddress());
            socket.get().close();
            socket.set(null);
            broadcastAddress.set(null);
            updates.clear();
            setTempoMaster(null);
            setDeviceNumber((byte)0);  // Set up for self-assignment if restarted.
            deliverLifecycleAnnouncement(logger, false);
        }
    }
197194
@Override
    public void stop() {
        if(isStarted.compareAndSet(true,false)){
            healthCheckService.shutdown();
            heartbeatService.shutdown();
        }
    }
739376
public void stop()
	{
		try
		{
			stopping = true;
			myServerSocket.close();
			myThread.join();
		}
		catch ( IOException | InterruptedException e ) {
			logger.log(Level.WARNING, "Had unexpected exception during stop", e);
		}
	}
306843
final static void stop() {
		if (lifeCycle.getStatus().equals(RunStatus.RUNNING) || lifeCycle.getStatus().equals(RunStatus.DISABLED)) {
			lifeCycle.setStatus(RunStatus.STOPPED);
			Log.info("Preparing to shutdown Audit4j...");

			Log.info("Closing Streams...");
			auditStream.close();

			Log.info("Shutdown handlers...");
			for (Handler handler : configContext.getHandlers()) {
				handler.stop();
				Log.info(handler.getClass().getName() + " shutdown.");
			}

			Log.info("Disposing configurations...");
			configContext = null;
			conf = null;
			Log.info("Audit4j shutdown completed.");
		} else {
			Log.info("No active Audit4j instance. Cancelling shutdown request.");
		}
	}
458085
public final void stop() {
        SystemException finalException = null;

        try {
            _interlock.await();
        } catch (InterruptedException ex) {
            Thread.currentThread().interrupt();
        } finally {
            try {
                if (_unlocked) {
                    _log.info("Stopping {}.", getName());
                    doStop();
                }
            } catch (Exception ex) {
                finalException = new SystemException(ex);
            } finally {
                _started = false;
            }
        }
        if (finalException != null) {
            throw finalException;
        }
    }