Stops the service.

@throws CommandFailedException If the command failed
556142
public function stop()
    {
        if (!$this->isRunning()) {
            return;
        }

        $process = $this->getProcess([
            'stop',
            $this->name,
        ]);

        $process->run();

        if (!$process->isSuccessful()) {
            throw new CommandFailedException($process);
        }
    }
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.");
  }
363611
public function stop()
    {
        if ($this->isBusy()) {
            posix_kill($this->workPid, \SIGKILL);
            $this->getWorkState(true);
        }
    }
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);
			}
		}

	}
816876
protected function stop()
    {
        $pid = $this->getCurrentPid();

        if (! $this->isRunning($pid)) {
            $this->error("Failed! There is no swoole_http_server process running.");

            return;
        }

        $this->info('Stopping swoole http server...');

        $isRunning = $this->killProcess($pid, SIGTERM, 15);

        if ($isRunning) {
            $this->error('Unable to stop the swoole_http_server process.');

            return;
        }

        // I don't known why Swoole didn't trigger "onShutdown" after sending SIGTERM.
        // So we should manually remove the pid file.
        $this->removePidFile();

        $this->info('> success');
    }
1245962
def stop(self):
        
        self.running = False
        # stop the command server
        try:
            self.commands_thread.kill()
        except:  # noqa e722
            pass

        try:
            self.lock.set()
            if self.config["debug"]:
                self.log("lock set, exiting")
            # run kill() method on all py3status modules
            for module in self.modules.values():
                module.kill()
        except:  # noqa e722
            pass
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;
        }
    }
190716
public void stop() {
    running = false;
    if (server != null) server.stop();
    if (aggregateDaemon != null) aggregateDaemon.interrupt();
  }
1326700
def stop(args):
  """"""
  if args.local:
    raise ValueError("Stopping commands locally is not supported (please kill them yourself)")
  jm = setup(args)
  jm.stop_jobs(get_ids(args.job_ids))
1221789
public void stop() {

        String thisMethodName = CLASS_NAME + ".stop()";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            // SibTr.entry(tc, thisMethodName);
        }

        // Get the MEs on this server
        Enumeration meEnum = _messagingEngines.elements();

        // Stop each ME on this server. Any exceptions are caught and
        // deliberately
        // not
        // rethrown as errors in one ME must not affect any others that might
        // exist.
        while (meEnum.hasMoreElements()) {
            Object o = meEnum.nextElement();
            Object c = ((MessagingEngine) o).getRuntime();
            try {

                ((BaseMessagingEngineImpl) c)
                                .stopConditional(JsConstants.ME_STOP_IMMEDIATE);
            } catch (Exception e) {
                FFDCFilter.processException(e, thisMethodName, "1:854:1.108",
                                            this);
                SibTr.exception(tc, e);
                SibTr.error(tc, "INTERNAL_ERROR_SIAS0003", e);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName);
        }
    }
1251405
synchronized void stop_polling() throws DevFailed {
        Util.out4.println("In stop_polling method");

        // Send command to the polling thread and wait for its execution
        final Util tg = Util.instance();
        final TangoMonitor mon = tg.get_poll_monitor();
        final PollThCmd shared_cmd = tg.get_poll_shared_cmd();
        if (shared_cmd.cmd_pending == true) {
            mon.signal();
        }
        shared_cmd.cmd_pending = true;
        shared_cmd.cmd_code = Tango_POLL_STOP;

        mon.signal();

        boolean interupted;
        while (shared_cmd.cmd_pending == true) {
            interupted = mon.wait_it(Tango_DEFAULT_TIMEOUT);

            if (shared_cmd.cmd_pending == true && interupted == false) {
                Util.out4.println("TIME OUT");
                Except.throw_exception("API_CommandTimedOut", "Polling thread blocked !!!",
                        "DServer.stop_polling");
            }
        }

        // Update polling status
        tg.poll_status(false);
        set_status("The device is ON\nThe polling is OFF");
    }
1119707
public void stop() {
    if (stopRequested) {
      return;
    }
    stopRequested = true;
    running = false;
    if (server != null) server.stop();
    if (triggerThread != null) triggerThread.interrupt();
    if (fileFixer != null) fileFixer.shutdown();
    if (fileFixerThread != null) fileFixerThread.interrupt();
    if (myMetrics != null) {
      myMetrics.shutdown();
    }
  }
571796
public synchronized void stop(boolean graceful)
        throws InterruptedException
    {
        boolean ov=_gracefulStop;
        try
        {
            _gracefulStop=graceful;
            stop();
        }
        finally
        {
            _gracefulStop=ov;
        }
    }
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;
        }
    }
55657
public void stop() {
    LOG.info("Stopping {}", getClass().getSimpleName());
    if (txService == null) {
      return;
    }
    try {
      if (txService.isRunning()) {
        txService.stopAndWait();
      }
    } catch (Throwable e) {
      LOG.error("Failed to shutdown transaction service.", e);
      // because shutdown hooks execute concurrently, the logger may be closed already: thus also print it.
      System.err.println("Failed to shutdown transaction service: " + e.getMessage());
      e.printStackTrace(System.err);
    }
  }
737582
@Override
    public void stop(){
        if(isStarted){
            synchronized (this) {
                if (isStarted) {
                    if (getLookupService() instanceof Closable) {
                        ((Closable) getLookupService()).stop();
                    }
                    isStarted = false;
                }
            }
        }
    }
142412
public void stop() {
		
		lock.lock();
		
		try {
			currentFuture.cancel(false);
			
			try {
				shutDown();
			} catch (Throwable t) {
				LOGGER.info("Exception in service shut down", t);
			}
			
			try {
				executorService.shutdown();
				executorService.awaitTermination(5, TimeUnit.SECONDS);
			} catch (Throwable t) {
				LOGGER.info("Exception in service termination", t);
			}
		} finally {
			lock.unlock();
		}
	}