Stops the application instance.

@return void
511761
public function stop()
    {

        // start application shutdown
        $this->synchronized(function ($self) {
            $self->applicationState = ApplicationStateKeys::get(ApplicationStateKeys::HALT);
        }, $this);

        do {
            // log a message that we'll wait till application has been shutdown
            \info(sprintf('Wait for application %s to be shutdown', $this->getName()));

            // query whether application state key is SHUTDOWN or not
            $waitForShutdown = $this->synchronized(function ($self) {
                return $self->applicationState->notEquals(ApplicationStateKeys::get(ApplicationStateKeys::SHUTDOWN));
            }, $this);

            // wait one second more
            sleep(1);

        } while ($waitForShutdown);
    }
806352
@Invalidate
    public void stop() {
        unregisterConfigurationsExposedAsServices();
        if (registration != null) {
            registration.unregister();
            registration = null;
            try {
                watcher.removeAndStopIfNeeded(configFile.getParentFile());
            } catch (RuntimeException e) { //NOSONAR
                // An exception can be thrown when the platform is shutting down.
                // ignore it.
            }
        }
    }
1178529
public function stop()
    {
        $this->getGarbageCollector()->stop();
        $this->getStartupBeanTaskGarbageCollector()->stop();
        $this->getObjectFactory()->stop();
    }
769862
private void stop() {
        complete();

        Citrus citrus = Citrus.CitrusInstanceManager.getSingleton();
        if (citrus != null) {
            log.info("Closing Citrus and its application context");
            citrus.close();
        }
    }
1270820
static public function stop()
    {
        if ( !self::$hasStarted )
        {
             return false;
        }
        session_write_close();
        self::$hasStarted = false;
        self::$handlerInstance = null;
        return true;
    }
914563
public function stop()
    {
        if ($this->isStarted()) {
            // trigger bbapplication.stop
            $this->getEventDispatcher()->dispatch('bbapplication.stop', new Event($this));
            $this->info('BackBee application ended');
        }
    }
1283370
protected function stopSession()
	{
		if ( $this->_session === null ) {
			return;
		}

		$this->_session->stop();
		$this->_session = null;
	}
922584
protected void stop() throws Exception {
		this.logger.debug("Stopping application");
		this.stopLock.lock();
		try {
			for (ConfigurableApplicationContext context : this.rootContexts) {
				context.close();
				this.rootContexts.remove(context);
			}
			cleanupCaches();
			if (this.forceReferenceCleanup) {
				forceReferenceCleanup();
			}
		}
		finally {
			this.stopLock.unlock();
		}
		System.gc();
		System.runFinalization();
	}
259599
def stop(self):
        '''  '''
        Global.LOGGER.debug(f"action {self.name} stopped")
        self.is_running = False
        self.on_stop()
313105
public function stop() {
		if( $this->started ) {
			exec(sprintf('kill %d',
				$this->pid));
		}

		$this->started = false;
	}
363611
public function stop()
    {
        if ($this->isBusy()) {
            posix_kill($this->workPid, \SIGKILL);
            $this->getWorkState(true);
        }
    }
79871
public function stop()
    {
        $options = static::getOptions();
        $debug = @$options['debug'] === true;

        $pidFile = $options['pid_file'];
        if (!$pidFile)
            throw new \Exception("No pid_file in the config");

        $fpPid = fopen($pidFile, "c");
        if (!$fpPid)
            throw new \Exception("Could not open " . $pidFile);

        if (flock($fpPid, LOCK_EX | LOCK_NB)) {
            flock($fpPid, LOCK_UN);
            fclose($fpPid);
            if ($debug)
                echo "==> Daemon not running" . PHP_EOL;
            return;
        }

        fclose($fpPid);
        $pid = (int)file_get_contents($pidFile);
        if ($debug)
            echo "==> Killing the daemon (PID $pid)..." . PHP_EOL;

        posix_kill($pid, SIGTERM);
        pcntl_waitpid($pid, $status);
    }
78667
public function stop()
    {
        $this->endTime = microtime(true);
        $this->endMemory = memory_get_peak_usage(true);

        return $this;
    }
416001
public static function stop()
    {
        if (self::$mode === self::MODE_DISABLED) {
            return;
        }

        $mode = self::$mode;

        if (self::$trace['tx'] === 'default' && self::$extension === self::EXTENSION_TIDEWAYS) {
            self::$trace['tx'] = tideways_transaction_name() ?: 'default';
        }

        if (function_exists('tideways_last_detected_exception') && $exception = tideways_last_detected_exception()) {
            self::logException($exception);
        } elseif (function_exists("http_response_code") && http_response_code() >= 500) {
            self::logFatal("PHP request set error HTTP response code to '" . http_response_code() . "'.", "", 0, E_USER_ERROR);
        }

        $profilingData = array();

        if (($mode & self::MODE_FULL) > 0 || self::$error) {
            if (self::$extension === self::EXTENSION_TIDEWAYS) {
                $profilingData = tideways_disable();
            } elseif (self::$extension === self::EXTENSION_XHPROF) {
                $profilingData = xhprof_disable();
                self::$currentRootSpan->stopTimer();
            }

            $annotations = array('mem' => ceil(memory_get_peak_usage() / 1024));

            if (self::$extension === self::EXTENSION_TIDEWAYS) {
                $annotations['xhpv'] = phpversion('tideways');

                if (self::$defaultOptions['framework']) {
                    $annotations['framework'] = self::$defaultOptions['framework'];
                }
            } elseif (self::$extension === self::EXTENSION_XHPROF) {
                $annotations['xhpv'] = phpversion('xhprof');
            }

            if (extension_loaded('xdebug')) {
                $annotations['xdebug'] = '1';
            }
            $annotations['php'] = PHP_VERSION;
            $annotations['sapi'] = php_sapi_name();

            if (isset($_SERVER['REQUEST_URI'])) {
                $annotations['title'] = '';
                if (isset($_SERVER['REQUEST_METHOD'])) {
                    $annotations['title'] = $_SERVER["REQUEST_METHOD"] . ' ';
                }

                if (isset($_SERVER['HTTP_HOST'])) {
                    $annotations['title'] .= (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . self::getRequestUri();
                } elseif(isset($_SERVER['SERVER_ADDR'])) {
                    $annotations['title'] .= (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['SERVER_ADDR'] . self::getRequestUri();
                }

                if (isset($_SERVER['QUERY_STRING'])) {
                    $annotations['query'] = $_SERVER['QUERY_STRING'];
                }

            } elseif ($annotations['sapi'] === "cli") {
                $annotations['title'] = basename($_SERVER['argv'][0]);
            }
        } else {
            self::$currentRootSpan->stopTimer();
            $annotations = array('mem' => ceil(memory_get_peak_usage() / 1024));
        }

        self::$currentRootSpan->annotate($annotations);

        if (($mode & self::MODE_PROFILING) > 0) {
            self::$trace['profdata'] = $profilingData ?: array();
        }

        self::$mode = self::MODE_DISABLED;

        $spans = self::$currentRootSpan->getSpans();

        if (self::$error === true || ($mode & self::MODE_FULL) > 0) {
            self::$trace['spans'] = $spans;
            self::$backend->socketStore(self::$trace);
        } else {
            self::$trace['spans'] = isset($spans[0]) ? array($spans[0]) : array(); // prevent flooding udp by accident
            self::$backend->socketStoreMeasurement(self::$trace);
        }
        self::$trace = null; // free memory
        self::$logLevel = 0;
    }
1100158
public function shutdown()
    {
        $frontendHelpers = $this->frontendHelperManager->getActivatedFrontendHelpers();

        foreach ($frontendHelpers as $frontendHelper) {
            /** @var FrontendHelper $frontendHelper */
            $frontendHelper->deactivate();
        }
    }
480170
public function stop()
    {

        // load the queue keys
        $queues = get_object_vars($this->getQueues());

        // iterate over the queues and shut them down
        /** @var AppserverIo\Psr\Pms\QueueInterface $queue */
        foreach ($queues as $queue) {
            $queue->stop();
        }
    }
764232
public function stop()
    {
        if (null === $this->sessionId) {
            throw new Exception("Session not started");
        }

        $this->doExecute('testComplete');
        $this->sessionId = null;
    }