This is the entry point method.
424638
public void onModuleLoad() {
        GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
            @Override
            public void onUncaughtException(Throwable e) {
                logger.log(SEVERE, "UncaughtException", e);
            }
        });
        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
            @Override
            public void execute() {
                //load map v3 api
                MapLoadUtil.loadMapApi(new Runnable() {
                    public void run() {
                        loadVisualisationApi();
                    }
                });
            }
        });
    }
491282
def main(self):
        
        parser = self.init_parser()
        self.args = parser.parse_args()

        if self.args.debug:
            coloredlogs.install(level=logging.DEBUG, fmt=LOG_FORMAT)

        self.work()
131306
public function main()
    {
        $this->validate();
        $this->datetimeTaskStart = new \DateTimeImmutable();

        if ($this->describeMainStack()) {
            $this->updateStacks();
        } else {
            $this->creationStacks();
        }

        while (!$this->stackIsReady()) {
            sleep(3);
            if (empty($this->events)) {
                $this->log("Waiting for stack provisioning...");
            }
        }

        $stacks = $this->describeMainStack($e);

        if (null === $stacks) {
            throw $e;
        }

        $outputLog = '';

        if ($stacks[0]['Outputs']) {
            foreach ($stacks[0]['Outputs'] as $row) {
                $outputLog .= PHP_EOL . $row['OutputKey'] . ': ' . $row['OutputValue'];
                if ($output = $this->getOutput($row['OutputKey'])) {
                    /** @var StackOutput $output */
                    $this->project->setProperty($output->getProperty(), $row['OutputValue']);
                }
            }
        }

        $this->log($outputLog);
    }
733179
public function main()
    {
        if (!$this->param('xml') && !$this->param('version')) {
            $this->out('<info>Current Paths:</info>', 2);
            $this->out('* app:  ' . APP_DIR . DIRECTORY_SEPARATOR);
            $this->out('* root: ' . ROOT . DIRECTORY_SEPARATOR);
            $this->out('* core: ' . CORE_PATH);
            $this->out('');

            $this->out('<info>Available Shells:</info>', 2);
        }

        if ($this->param('version')) {
            $this->out(Configure::version());

            return;
        }

        $shellList = $this->Command->getShellList();
        if (!$shellList) {
            return;
        }

        if (!$this->param('xml')) {
            $this->_asText($shellList);
        } else {
            $this->_asXml($shellList);
        }
    }
1142749
def main():
    
    parser = getBasicOptionParser()
    initializeOptions(parser)
    options = parseBasicOptions(parser)
    checkOptions(options, parser)
    config = Config()
    config.setOptions(options)
    jobStore = Toil.resumeJobStore(config.jobStore)
    stats = getStats(jobStore)
    collatedStatsTag = processData(jobStore.config, stats)
    reportData(collatedStatsTag, options)
43246
public function main()
    {
        $this->validate();

        $targetDatabase = $this->getTargetDatabase();

        $platform = $this->getGeneratorConfig()->getConfiguredPlatform();

        // Load the Data XML -> DB Name properties
        $map = new Properties();
        try {
            $map->load($this->getDataDbMap());
        } catch (IOException $ioe) {
            throw new BuildException("Cannot open and process the datadbmap!", $ioe);
        }

        // Parse each file in the data -> db map
        foreach ($map->keys() as $dataXMLFilename) {

            $dataXMLFile = new PhingFile($this->srcDir, $dataXMLFilename);

            // if file exists then proceed
            if ($dataXMLFile->exists()) {

                $dbname = $map->get($dataXMLFilename);

                $db = $this->getDatabase($dbname);

                if (!$db) {
                    throw new BuildException("Cannot find instantiated Database for name '$dbname' from datadbmap file.");
                }

                $db->setPlatform($platform);

                $outFile = $this->getMappedFile($dataXMLFilename);
                $sqlWriter = new FileWriter($outFile);

                $this->log("Creating SQL from XML data dump file: " . $dataXMLFile->getAbsolutePath());

                try {
                    $dataXmlParser = new XmlToDataSQL($db, $this->getGeneratorConfig(), $this->dbEncoding);
                    $dataXmlParser->transform($dataXMLFile, $sqlWriter);
                } catch (Exception $e) {
                    throw new BuildException("Exception parsing data XML: " . $e->getMessage());
                }

                // Place the generated SQL file(s)
                $p = new Properties();
                if ($this->getSqlDbMap()->exists()) {
                    $p->load($this->getSqlDbMap());
                }

                $p->setProperty($outFile->getName(), $db->getName());
                $p->store($this->getSqlDbMap(), "Sqlfile -> Database map");
            } else {
                $this->log("File '" . $dataXMLFile->getAbsolutePath() . "' in datadbmap does not exist, so skipping it.", Project::MSG_WARN);
            }
        } // foreach data xml file

    }
558929
protected function starting() : void
    {
        $this->agg = (new Aggregator($this))->start();
        $this->out = (new Prometheus($this->host, $this->app, $this->agg))->start($this->listener, $this->gateway);
        $this->cls = (new Cleaner($this))->start();
    }
41538
public function main()
    {
        $this->vendorDir = WWW_ROOT . 'node_modules';
        
        $this->fontawesomePath = $this->vendorDir . DS . '@fortawesome' . DS . 'fontawesome-free' . DS;
        $this->jqueryBackstretchPath = $this->vendorDir . DS . 'jquery-backstretch' . DS;
        $this->jqueryUiPath = $this->vendorDir . DS . 'components-jqueryui' . DS;
        $this->owlCarouselPath = $this->vendorDir . DS . 'owl.carousel' . DS;
        $this->tooltipsterPath = $this->vendorDir . DS . 'tooltipster' . DS;
        
        $this->cleanOverheadFromDependencies();
        $this->copyAdaptedElfinderFiles();
        $this->copyJqueryUiImages();
        $this->copyFontawesomeFonts();
    }
1370589
def entry_point():
    """"""
    try:
        provider_group_factory()
        notifiers_cli(obj={})
    except NotifierException as e:
        click.secho(f"ERROR: {e.message}", bold=True, fg="red")
        exit(1)
1025967
public function main()
    {
        $this->out('Welcome to the Proffer shell.');
        $this->out('This shell can be used to regenerate thumbnails and cleanup unlinked images.');
        $this->hr();
        $this->out($this->OptionParser->help());
    }
930909
public function main()
    {

        // register the default autoloader
        require SERVER_AUTOLOADER;

        // initialize the container state
        $this->containerState = ContainerStateKeys::get(ContainerStateKeys::WAITING_FOR_INITIALIZATION);

        // create a new API app service instance
        $this->service = $this->newService('AppserverIo\Appserver\Core\Api\AppService');

        // initialize the container for the configured class laoders
        $classLoaders = new GenericStackable();

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

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

        // query whether the container's directories exists and are readable
        $this->validateDirectories();

        // initialize the naming directory with the environment data
        $this->namingDirectory->createSubdirectory(sprintf('php:env/%s', $this->getName()));
        $this->namingDirectory->createSubdirectory(sprintf('php:global/%s', $this->getName()));
        $this->namingDirectory->createSubdirectory(sprintf('php:global/log/%s', $this->getName()));
        $this->namingDirectory->bind(sprintf('php:env/%s/appBase', $this->getName()), $this->getAppBase());
        $this->namingDirectory->bind(sprintf('php:global/%s/runlevel', $this->getName()), $this->getRunlevel());

        // initialize the container state
        $this->containerState = ContainerStateKeys::get(ContainerStateKeys::INITIALIZATION_SUCCESSFUL);

        // initialize instance that contains the applications
        $this->applications = new GenericStackable();

        // initialize the profile logger and the thread context
        if ($profileLogger = $this->getInitialContext()->getLogger(LoggerUtils::PROFILE)) {
            $profileLogger->appendThreadContext($this->getContainerNode()->getName());
        }

        // initialize the array for the server configurations
        $serverConfigurations = array();

        // load the server configurations and query whether a server signatures has been set
        /** @var \AppserverIo\Appserver\Core\Api\Node\ServerNodeInterface $serverNode */
        foreach ($this->getContainerNode()->getServers() as $serverNode) {
            $serverConfigurations[] = $this->getServerNodeConfiguration($serverNode);
        }

        // init upstreams
        $upstreams = array();
        if ($this->getContainerNode()->getUpstreams()) {
            $upstreams = $this->getContainerNode()->getUpstreams();
            foreach ($this->getContainerNode()->getUpstreams() as $upstreamNode) {
                // get upstream type
                $upstreamType = $upstreamNode->getType();
                // init upstream instance
                $upstream = new $upstreamType();
                // init upstream servers
                $servers = array();
                // get upstream servers from upstream
                foreach ($upstreamNode->getUpstreamServers() as $upstreamServerNode) {
                    $upstreamServerType = $upstreamServerNode->getType();
                    $upstreamServerParams = $upstreamServerNode->getParamsAsArray();
                    $servers[$upstreamServerNode->getName()] = new $upstreamServerType($upstreamServerParams);
                }
                // inject server instances to upstream
                $upstream->injectServers($servers);
                // set upstream by name
                $upstreams[$upstreamNode->getName()] = $upstream;
            }
        }

        // init server array
        $this->servers = new GenericStackable();

        // start servers by given configurations
        /** @var \AppserverIo\Server\Interfaces\ServerConfigurationInterface $serverConfig */
        foreach ($serverConfigurations as $serverConfig) {
            // get type definitions
            $serverType = $serverConfig->getType();
            $serverContextType = $serverConfig->getServerContextType();

            // create a new instance server context
            /** @var \AppserverIo\Server\Interfaces\ServerContextInterface $serverContext */
            $serverContext = new $serverContextType();

            // inject container to be available in specific mods etc. and initialize the module
            $serverContext->injectContainer($this);

            // init server context by config
            $serverContext->init($serverConfig);

            // inject upstreams
            $serverContext->injectUpstreams($upstreams);

            // inject loggers
            $serverContext->injectLoggers($this->getInitialContext()->getLoggers());

            // create the server (which should start it automatically)
            /** @var \AppserverIo\Server\Interfaces\ServerInterface $server */
            $server = new $serverType($serverContext);
            // collect the servers we started
            $this->servers[$serverConfig->getName()] = $server;
        }

        // wait for all servers to be started
        $waitForServers = true;
        while ($waitForServers === true) {
            // iterate over all servers to check the state
            foreach ($this->servers as $server) {
                if ($server->serverState === ServerStateKeys::WORKERS_INITIALIZED) {
                    $waitForServers = false;
                } else {
                    $waitForServers = true;
                }
            }
            usleep(10000);
        }

        // the container has successfully been initialized
        $this->synchronized(function ($self) {
            $self->containerState = ContainerStateKeys::get(ContainerStateKeys::SERVERS_STARTED_SUCCESSFUL);
        }, $this);

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

        // wait till container will be shutdown
        while ($keepRunning) {
            // query whether we've a profile logger, log resource usage
            if ($profileLogger) {
                $profileLogger->debug(sprintf('Container %s still waiting for shutdown', $this->getContainerNode()->getName()));
            }

            // wait a second to lower system load
            $keepRunning = $this->synchronized(function ($self) {
                $self->wait(1000000 * AbstractContainerThread::TIME_TO_LIVE);
                return $self->containerState->equals(ContainerStateKeys::get(ContainerStateKeys::SERVERS_STARTED_SUCCESSFUL));
            }, $this);
        }

        // we need to stop all servers before we can shutdown the container
        /** @var \AppserverIo\Server\Interfaces\ServerInterface $server */
        foreach ($this->servers as $server) {
            $server->stop();
        }

        // mark the container as successfully shutdown
        $this->synchronized(function ($self) {
            $self->containerState = ContainerStateKeys::get(ContainerStateKeys::SHUTDOWN);
        }, $this);

        // send log message that the container has been shutdown
        $this->getInitialContext()->getSystemLogger()->info(
            sprintf('Successfully shutdown container %s', $this->getContainerNode()->getName())
        );
    }
846744
public function main()
    {
        $this->validateAttributes();

        if ($this->action == 'w') {
            $this->write();
        } elseif ($this->action == 'r') {
            $this->read();
        }
    }
167958
public function main()
    {
        declare(ticks = 1);
        pcntl_signal(SIGINT, function () {
            exit(0);
        });

        $kubernetesClient = $this->getKubernetesClient();
        $storeEnabled = $this->getStoreEnabled();

        if ($storeEnabled) {
            $this->store = new Store($this);
            $this->store->init();
        }

        $watches = new \KubernetesClient\WatchCollection();

        $configMapNamespace = $this->getConfigMapNamespace();
        $configMapName = $this->getConfigMapName();

        $storeNamespace = $this->getStoreNamespace();
        $storeName = $this->getStoreName();

        //controller config
        $watch = $kubernetesClient->createWatch("/api/v1/watch/namespaces/${configMapNamespace}/configmaps/${configMapName}", [], $this->getConfigMapWatchCallback());
        $watches->addWatch($watch);

        while (true) {
            usleep(100 * 1000);
            $watches->start(1);

            // do NOT perform anything until config is loaded
            if (!$this->getConfigLoaded()) {
                $this->log("waiting for ConfigMap ${configMapNamespace}/${configMapName} to be present and valid");
                sleep(5);
                continue;
            }

            // do NOT perform anything until store is ready
            if ($storeEnabled) {
                if (!$this->store->initialized()) {
                    $this->log("waiting for store ConfigMap ${storeNamespace}/${storeName} to be present and valid");
                    $this->store->init();
                    sleep(5);
                    continue;
                }
            }

            // update store data
            if ($storeEnabled) {
                $this->store->readWatches();
            }

            // process plugins
            foreach ($this->plugins as $plugin) {
                $plugin->preReadWatches();
                $plugin->readWatches();
                $plugin->postReadWatches();

                if ($plugin->getActionRequired()) {
                    // be patient in failure scenarios
                    if (!$plugin->getLastActionSuccess() && ((time() - $this->failedActionWaitTime) <= $plugin->getLastActionAttemptTime())) {
                        continue;
                    }

                    // wait for settle time
                    $settleTime = $plugin->getSettleTime();
                    $actionRequiredTime = $plugin->getActionRequiredTime();
                    if ($settleTime > 0 &&
                        $actionRequiredTime > 0 &&
                        ((time() - $actionRequiredTime) <= $settleTime)) {
                        continue;
                    }

                    // wait for throttle time
                    $throttleTime = $plugin->getThrottleTime();
                    $lastActionAttemptTime = $plugin->getLastActionAttemptTime();
                    if ($throttleTime > 0 &&
                        $lastActionAttemptTime > 0 &&
                        ((time() - $lastActionAttemptTime) <= $throttleTime)) {
                        continue;
                    }

                    $plugin->invokeAction();
                }
            }

            // update store data
            if ($storeEnabled) {
                $this->store->readWatches();
            }
        }
    }
488178
def start(self):
        
        component = Component(self.config, self.handlers)
        component.run()
493977
public function beginStepping() {
		$this->state = self::STATE_START;
		$this->preprocess();
		$this->listener->startDocument( $this, null, null );
	}
42426
@PostConstruct
    public void start() {
        threadFactory = Executors.defaultThreadFactory();
        disruptor = new Disruptor<>(Registration.FACTORY,
                ringSize,
                threadFactory,
                ProducerType.MULTI,
                new BlockingWaitStrategy());
        disruptor.handleEventsWith(new ContainerEventHandler());
        ringBuffer = disruptor.start();
    }
1343891
def main_callback(self, *args, **kwargs):
        
        if not self.callback:
            raise NotImplementedError('Entrypoints must declare `callback`')
        if not self.settings:
            raise NotImplementedError('Entrypoints must declare `settings`')

        self.callback.im_self.db = None

        #1. Start all the middlewares
        with self.debug(*args, **kwargs):
            with self.database():
                #2. `Real` callback
                result = self.callback(*args, **kwargs)#pylint: disable=not-callable
        return result