Executed on startup of application
166799
def run(self):
        """"""
        for wsock in self.wsocks:
            wsock.run()
        for api in self.apis:
            api.run()
740008
public function execute()
	{
		putenv('LINES=' . $this->terminal->getHeight());
		putenv('COLUMNS=' . $this->terminal->getWidth());

		$this->configureIO();

		try
		{
			$this->dispatchEvent(ApplicationEvents::BEFORE_EXECUTE);

			// Perform application routines.
			$exitCode = $this->doExecute();

			$this->dispatchEvent(ApplicationEvents::AFTER_EXECUTE);
		}
		catch (\Throwable $throwable)
		{
			if (!$this->shouldCatchThrowables())
			{
				throw $throwable;
			}

			$event = new ApplicationErrorEvent($throwable, $this, $this->runningCommand);

			$this->dispatchEvent(ConsoleEvents::APPLICATION_ERROR, $event);

			$exitCode = $event->getExitCode();

			if (is_numeric($exitCode))
			{
				$exitCode = (int) $exitCode;

				if ($exitCode === 0)
				{
					$exitCode = 1;
				}
			}
			else
			{
				$exitCode = 1;
			}
		}
		finally
		{
			if ($this->shouldAutoExit() && isset($exitCode))
			{
				$exitCode = $exitCode > 255 ? 255 : $exitCode;
				$this->close($exitCode);
			}
		}
	}
364636
protected synchronized void doStart()
        throws Exception
    {
        if (isStarted())
            return;
        
        _contextLog = LogFactory.getLog("org.browsermob.proxy.jetty.jetty.context."+getHttpContext().getHttpContextName());
        
        if (_contextLog==null)
            _contextLog=log;
        
        if (_sessionManager!=null)
            _sessionManager.start();
        
        // Initialize classloader
        _loader=getHttpContext().getClassLoader();

        if (_autoInitializeServlets)
            initializeServlets();
    }
640862
public function on_start()
    {
        $cookieJar = $this->app->make(CookieJar::class);
        $this->token = $this->app->make('token');
        $this->error = $this->app->make('error');
        $this->entityManager = $this->app->make(EntityManagerInterface::class);
        $this->set('interface', $this->app->make('helper/concrete/ui'));
        $this->set('dashboard', $this->app->make('helper/concrete/dashboard'));
        $this->set('hideDashboardPanel', $cookieJar->get('dashboardPanelStatus') === 'closed');
        // @todo fix this approach
        $this->app->make('helper/concrete/dashboard');
        $dh = DashboardMenu::getMine();
        if ($dh->contains($this->getPageObject())) {
            $this->set('_bookmarked', true);
        } else {
            $this->set('_bookmarked', false);
        }
    }
174821
def on_startup(self):
        

        LOGGER.debug("> Calling '{0}' Component Framework 'on_startup' method.".format(self.__class__.__name__))

        factory_default_script_editor_file = umbra.ui.common.get_resource_path(
            self.__factory_default_script_editor_file)
        if foundations.common.path_exists(factory_default_script_editor_file) and \
                not foundations.common.path_exists(self.__default_script_editor_file):
            shutil.copyfile(factory_default_script_editor_file, self.__default_script_editor_file)

        if foundations.common.path_exists(self.__default_script_editor_file):
            self.load_file(self.__default_script_editor_file)
        else:
            self.new_file()

        startup_script = self.__engine.parameters.startup_script
        if foundations.common.path_exists(startup_script):
            self.load_file(startup_script) and self.evaluate_script()

        self.restore_session()

        for argument in self.__engine.arguments[1:]:
            file = os.path.abspath(argument)
            if foundations.common.path_exists(file):
                os.path.isfile(file) and self.load_file(file)

        return True
378260
public void execute() {
        List<ICareWebStartup> temp = new ArrayList<>(startupRoutines);
        
        for (ICareWebStartup startupRoutine : temp) {
            try {
                if (startupRoutine.execute()) {
                    unregisterObject(startupRoutine);
                }
            } catch (Throwable t) {
                log.error("Error executing startup routine.", t);
                unregisterObject(startupRoutine);
            }
        }
    }
124635
protected function triggerOnStartup(): AbstractApplication
    {
        foreach ($this->getModules() as $module) {
            if ($module instanceof StartupProviderInterface) {
                $module->onStartup(
                    $this->getServiceLocator()
                );
            }
        }

        return $this;
    }
293979
public void startup() {
        if (isRunning) return;

        Executors.getInstance().execute(new Runnable() {
            @Override
            public void run() {
                DispatcherHandler handler = new DispatcherHandler(AndServer.getContext());
                ComponentRegister register = new ComponentRegister(AndServer.getContext());
                register.register(handler, mGroup);

                mHttpServer = ServerBootstrap.bootstrap()
                    .setSocketConfig(SocketConfig.custom()
                        .setSoKeepAlive(true)
                        .setSoReuseAddress(true)
                        .setSoTimeout(mTimeout)
                        .setTcpNoDelay(true)
                        .build())
                    .setConnectionConfig(
                        ConnectionConfig.custom().setBufferSize(4 * 1024).setCharset(Charsets.UTF_8).build())
                    .setLocalAddress(mInetAddress)
                    .setListenerPort(mPort)
                    .setSslContext(mSSLContext)
                    .setSslSetupHandler(new SSLInitializerWrapper(mSSLInitializer))
                    .setServerInfo("AndServer/2.0.0")
                    .registerHandler("*", handler)
                    .setExceptionLogger(ExceptionLogger.NO_OP)
                    .create();
                try {
                    isRunning = true;
                    mHttpServer.start();

                    Executors.getInstance().post(new Runnable() {
                        @Override
                        public void run() {
                            if (mListener != null) mListener.onStarted();
                        }
                    });
                    Runtime.getRuntime().addShutdownHook(new Thread() {
                        @Override
                        public void run() {
                            mHttpServer.shutdown(3, TimeUnit.SECONDS);
                        }
                    });
                } catch (final Exception e) {
                    Executors.getInstance().post(new Runnable() {
                        @Override
                        public void run() {
                            if (mListener != null) mListener.onException(e);
                        }
                    });
                }
            }
        });
    }
156940
function(opt) {

        if ( !Config.initialized) {
            var env = opt.env;

            self.startingApp = opt.startingApp;
            self.executionPath = opt.executionPath;

            self.task = opt.task || 'run'; // to be aible to filter later on non run task

            self.userConf = false;
            var path = _(self.executionPath + '/env.json');

            if ( fs.existsSync(path) ) {

                self.userConf = require(path);
                console.debug('Application config file loaded ['
                    + _(self.executionPath + '/env.json') + ']');
            }

            self.Env.parent = self;
            if (env != 'undefined') self.Env.set(env);

            self.Host.parent = self;

            //Do some checking please.. like already has a PID ?.
            //if yes, join in case of standalone.. or create a new thread.
            self.Host.setMaster(opt.startingApp);

            getConf()
        } else {
            if (!opt) {
                return Config.instance
            } else {
                return self.getInstance(opt.startingApp)
            }
        }
    }
321473
def init_app(self, app):
        """"""
        if self.module:
            app.config.from_object(self.module)
906862
void onStart() {

    LOG.log(Level.FINEST, "YARN registration: begin");

    this.nodeManager.init(this.yarnConf);
    this.nodeManager.start();

    try {

      this.yarnProxyUser.doAs(
          new PrivilegedExceptionAction<Object>() {
            @Override
            public Object run() throws Exception {
              resourceManager.init(yarnConf);
              resourceManager.start();
              return null;
            }
          });

      LOG.log(Level.FINE, "YARN registration: register AM at \"{0}:{1}\" tracking URL \"{2}\"",
          new Object[] {amRegistrationHost, AM_REGISTRATION_PORT, this.trackingUrl});

      this.registration.setRegistration(this.resourceManager.registerApplicationMaster(
          amRegistrationHost, AM_REGISTRATION_PORT, this.trackingUrl));

      LOG.log(Level.FINE, "YARN registration: AM registered: {0}", this.registration);

      final FileSystem fs = FileSystem.get(this.yarnConf);
      final Path outputFileName = new Path(this.jobSubmissionDirectory, this.reefFileNames.getDriverHttpEndpoint());

      try (final FSDataOutputStream out = fs.create(outputFileName)) {
        out.writeBytes(this.trackingUrl + '\n');
      }

    } catch (final Exception e) {
      LOG.log(Level.WARNING, "Unable to register application master.", e);
      onRuntimeError(e);
    }

    LOG.log(Level.FINEST, "YARN registration: done: {0}", this.registration);
  }
283472
protected void onInit(Holo config, Bundle savedInstanceState) {
        if (mInited) {
            throw new IllegalStateException("This instance was already inited");
        }
        mInited = true;
        if (config == null) {
            config = createConfig(savedInstanceState);
        }
        if (config == null) {
            config = Holo.defaultConfig();
        }
        onPreInit(config, savedInstanceState);
        if (!config.ignoreApplicationInstanceCheck && !(getApplication() instanceof Application)) {
            boolean throwError = true;
            if (config.allowMockApplicationInstance) {
                try {
                    throwError = !(getApplication() instanceof MockApplication);
                    if (!throwError) {
                        Log.w("HoloEverywhere", "Application instance is MockApplication. Wow. Let's begin tests...");
                    }
                } catch (Exception e) {
                }
            }
            if (throwError) {
                String text = "Application instance isn't HoloEverywhere.\n";
                if (getApplication().getClass() == android.app.Application.class) {
                    text += "Put attr 'android:name=\"org.holoeverywhere.app.Application\"'" +
                            " in <application> tag of AndroidManifest.xml";
                } else {
                    text += "Please sure that you extend " + getApplication().getClass() +
                            " from a org.holoeverywhere.app.Application";
                }
                throw new IllegalStateException(text);
            }
        }
        getLayoutInflater().setFragmentActivity(this);
        if (this instanceof Activity) {
            final Activity activity = (Activity) this;
            ThemeManager.applyTheme(activity, mLastThemeResourceId == 0);
            if (!config.ignoreThemeCheck && ThemeManager.getThemeType(this) == ThemeManager.INVALID) {
                throw new HoloThemeException(activity);
            }
            TypedArray a = obtainStyledAttributes(new int[]{android.R.attr.windowActionBarOverlay, R.attr.windowActionBarOverlay});
            if (a.getBoolean(0, false) || a.getBoolean(1, false)) {
                supportRequestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
            }
            a.recycle();
            a = obtainStyledAttributes(new int[]{android.R.attr.windowActionModeOverlay, R.attr.windowActionBarOverlay});
            if (a.getBoolean(0, false) || a.getBoolean(1, false)) {
                supportRequestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY);
            }
            a.recycle();
        }
        onPostInit(config, savedInstanceState);
        lockAttaching();
    }
432695
def run(self):
        
        # Make sure everything is in sync, before starting.
        self.sync_with_prompt_toolkit()

        def pre_run():
            # Start in navigation mode.
            self.application.vi_state.input_mode = InputMode.NAVIGATION

        # Run eventloop of prompt_toolkit.
        self.application.run(pre_run=pre_run)
1052776
public function onStart()
    {
        $this->setProcessName('master process');
        $this->createPidFile();

        $this->container->event->trigger('swoole.start', func_get_args());
    }
447932
def start():
    """"""
    global app
    bottle.run(app, host=conf.WebHost, port=conf.WebPort,
               debug=conf.WebAutoReload, reloader=conf.WebAutoReload,
               quiet=conf.WebQuiet)
651031
function main(onStart) {
    const conf = config.read();

    initLogging(conf);
    initFsStorage(conf);

    logger.debug('Default configuration file: %s', conf.path);
    logger.debug('Configuration parameters: %s', JSON.stringify(conf));

    runWebServer(conf, onStart);
}
1295965
def start(self):
        '''  '''
        self._app.run(host=self._host, port=self._port)