Start the application.

        Support for start-callbacks and lock the application's configuration and plugins.
195371
async def startup(self):
        
        if self.frozen:
            return False

        if self._error_handlers:
            self.middlewares.append(_exc_middleware_factory(self))

        # Register static paths
        for path in self.cfg.STATIC_FOLDERS:
            self.router.register_resource(SafeStaticResource(self.cfg.STATIC_PREFIX, path))

        await super(Application, self).startup()
398808
def start(self, *args, **kwargs):
        
        args = (self.counter,) + args
        thread = threading.Thread(
                target=self._work_callback,
                args=args, kwargs=kwargs
                )
        thread.setDaemon(self.daemon)
        thread.start()
411037
public function run()
    {

        try {
            // register the default autoloader
            require SERVER_AUTOLOADER;

            // register shutdown handler
            register_shutdown_function(array(&$this, "shutdown"));

            // add the application instance to the environment
            Environment::singleton()->setAttribute(EnvironmentKeys::APPLICATION, $this);

            // create s simulated request/session ID whereas session equals request ID
            Environment::singleton()->setAttribute(EnvironmentKeys::SESSION_ID, $sessionId = SessionUtils::generateRandomString());
            Environment::singleton()->setAttribute(EnvironmentKeys::REQUEST_ID, $sessionId);

            // log a message that we now start to connect the application
            $this->getInitialContext()->getSystemLogger()->debug(sprintf('%s wait to be connected', $this->getName()));

            // register the class loaders
            $this->registerClassLoaders();

            // register the annotation registries
            $this->registerAnnotationRegistries();

            // initialize the managers
            $this->initializeManagers();

            // provision the application
            if ($this->getContainer()->hasProvisioningEnabled()) {
                $this->provision();
            }

            // initialize the profile logger and the thread context
            $profileLogger = null;
            /** @var \AppserverIo\Logger\ThreadSafeLoggerInterface $profileLogger */
            if ($profileLogger = $this->getInitialContext()->getLogger(LoggerUtils::PROFILE)) {
                $profileLogger->appendThreadContext('application');
            }

            // invoke the application's managers postStartup() lifecycle callbacks
            $this->postStartupManagers();

            // the application has successfully been initialized
            $this->synchronized(function ($self) {
                $self->applicationState = ApplicationStateKeys::get(ApplicationStateKeys::INITIALIZATION_SUCCESSFUL);
            }, $this);

            // log a message that we has successfully been connected now
            \info(sprintf('%s has successfully been connected', $this->getName()));

            // initialize the flag to keep the application running
            $keepRunning = true;

            // wait till application will be shutdown
            while ($keepRunning) {
                // query whether we've a profile logger, log resource usage
                if ($profileLogger) {
                    $profileLogger->debug(sprintf('Application %s is running', $this->getName()));
                }

                // wait a second to lower system load
                $keepRunning = $this->synchronized(function ($self) {
                    $self->wait(100000 * Application::TIME_TO_LIVE);
                    return $self->applicationState->equals(ApplicationStateKeys::get(ApplicationStateKeys::INITIALIZATION_SUCCESSFUL));
                }, $this);
            }

            // log a message that we has successfully been shutdown now
            \info(sprintf('%s start to shutdown managers', $this->getName()));

            // array for the manager shutdown threads
            $shutdownThreads = array();

            // we need to stop all managers, because they've probably running threads
            /** @var \AppserverIo\Psr\Application\ManagerInterface $manager */
            foreach ($this->getManagers() as $manager) {
                $shutdownThreads[] = new ManagerShutdownThread($manager);
            }

            // wait till all managers have been shutdown
            /** @var \AppserverIo\Appserver\Application\ManagerShutdownThread $shutdownThread */
            foreach ($shutdownThreads as $shutdownThread) {
                $shutdownThread->join();
            }

            // the application has been shutdown successfully
            $this->synchronized(function ($self) {
                $self->applicationState = ApplicationStateKeys::get(ApplicationStateKeys::SHUTDOWN);
            }, $this);

            // cleanup the naming directory with the application entries
            $this->unload();

            // log a message that we has successfully been shutdown now
            \info(sprintf('%s has successfully been shutdown', $this->getName()));

        } catch (\Exception $e) {
            LoggerUtils::log(LogLevel::ERROR, $e);
        }
    }
481631
public static ConfigurableApplicationContext start(Class<?> app, String... args) {
        return start(new Class<?>[]{app}, args);
    }
1295197
def startup():
    
    model.setup()
    index.scan_index(config.content_folder)
    index.background_scan(config.content_folder)
1256101
public void start() {
        if (state == State.RUNNING) return;
        final Lock lock = this.lock.writeLock();
        try {
            lock.lock();
            this.state = State.STARTING;

            // Create an executor service that we'll use to start the repositories ...
            ThreadFactory threadFactory = new NamedThreadFactory("modeshape-start-repo");
            repositoryStarterService = Executors.newCachedThreadPool(threadFactory);

            state = State.RUNNING;
        } catch (RuntimeException e) {
            state = State.NOT_RUNNING;
            throw e;
        } finally {
            lock.unlock();
        }
    }
905604
def start():
    
    pool = gevent.threadpool.ThreadPool(len(ENTRYPOINTS))
    for entrypoint, callback, args, kwargs in ENTRYPOINTS:
        cname = callback.__name__
        #1. Retrieve the class which owns the callback
        for name, klass in inspect.getmembers(sys.modules[callback.__module__], inspect.isclass):
            if hasattr(klass, cname):
                service_name = name.lower()
                break
        #2.Start the entrypoint
        callback = getattr(klass(), cname)
        kwargs.update({'service':service_name, 'callback':callback, 'callback_name': cname})
        LOGGER.info('Start service %s[%s].', service_name.capitalize(), cname)
        obj = entrypoint(*args, **kwargs)
        pool.spawn(obj.start, *args, **kwargs)
    pool.join()
    return True
447349
def start(self):
        
        self.thread_handler.run(target=self.start_blocking)
        self.thread_handler.start_run_loop()
8255
def start(**kwargs):
    
    if CORE_MANAGER.started:
        raise RuntimeConfigError('Current context has to be stopped to start '
                                 'a new context.')

    try:
        waiter = kwargs.pop('waiter')
    except KeyError:
        waiter = hub.Event()
    common_config = CommonConf(**kwargs)
    hub.spawn(CORE_MANAGER.start, *[], **{'common_conf': common_config,
                                          'waiter': waiter})
    return True
788399
def run(app: web.Application):
    
    host = app['config']['host']
    port = app['config']['port']

    # starts app. run_app() will automatically start the async context.
    web.run_app(app, host=host, port=port)
305743
public void start()
  {
    _systemManager.start();
    
    logStartComplete();

    // non-daemon thread to prevent quick exit
    Thread thread = new Thread(this::join);
    thread.setName("baratine-join");
    thread.start();
  }
1312583
function start(options, callback) {
  const args = utils.getArgs(options, [config], callback);

  app.set("config", args.options);
  server.listen(args.options.port, args.options.ip, function() {
    return args.callback(null);
  }).on("error", function(err) {
    if (err.code === "EADDRINUSE") {
      return args.callback(err);
    }
    console.error(err);
  });
}
943797
private void start() {
        if (m_bRunning) {
            m_logger.warn("start: Already started -- ignoring");
            return;
        }
        Locale.setDefault(Locale.ROOT);
        m_logger.info("Doradus Version: {}", getDoradusVersion());
        hookShutdownEvent();
        startServices();
        m_bRunning = true;
    }
462898
def __start(self):  # pragma: no cover
        """"""

        assert not self._listener_thread

        self._listener_thread = threading.Thread(target=self.__run_listener,
                                                 name='clearly-listener')
        self._listener_thread.daemon = True
        self._listener_thread.start()
        self._wait_event.wait()
        self._wait_event.clear()
301286
public function startApplication() : void
    {
        if ($this->hasApplicationBeenStarted()) {
            throw new ApplicationRunningException(sprintf('Application has already been started. Please stop the application, before invoking start!'));
        }

        $this->refreshApplication();

        if (!$this->factory) {
            $this->factory = $this->app->make(Factory::class);
        }
    }
1078528
def _app_base_start(self, option: str, args: list or tuple) -> None:
        '''
        
        '''
        _, error = self._execute('-s', self.device_sn,
                                 'shell', 'am', 'start', option, *args)
        if error and error.startswith('Error'):
            raise ApplicationsException(error.split(':', 1)[-1].strip())
131564
def start(self, *args, **kwargs):
        
        wait = kwargs.pop("wait", False)

        # Initial setup
        self._setup(*args, **kwargs)

        # Build dirs and files.
        self.build(*args, **kwargs)

        # Submit tasks (does not block)
        self.submit_tasks(wait=wait)