All components have initialized, set up the component
        configuration schema-store, run the local server and drop privileges
182925
def ready(self, source):
        """"""

        from hfos.database import configschemastore
        configschemastore[self.name] = self.configschema

        self._start_server()

        if not self.insecure:
            self._drop_privileges()

        self.fireEvent(cli_register_event('components', cli_components))
        self.fireEvent(cli_register_event('drop_privileges', cli_drop_privileges))
        self.fireEvent(cli_register_event('reload_db', cli_reload_db))
        self.fireEvent(cli_register_event('reload', cli_reload))
        self.fireEvent(cli_register_event('quit', cli_quit))
        self.fireEvent(cli_register_event('info', cli_info))
1116742
@PostConstruct
    public void init() throws Exception {

        if (hosts == null) {
            throw new IllegalArgumentException("Hosts property not set ");
        }

        determineHostsAsProperty();

        /**
         * quick fix for integration tests. if hosts property set to "embedded" then a local node is start.
         * maven dependencies need to be defined correctly for this to work
         */

        if (hosts.startsWith("embedded")) {
            synchronized (SYNC) {
                if (node == null) {
                    node = new ElasticsearchEmbeddedNode();
                }
            }
            client = node.getClient();
        } else {
            String[] hostsArray = hosts.split(",");
            Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", cluster).build();
            client = new TransportClient(settings);

            for (String aHostsArray : hostsArray) {
                String s = aHostsArray.trim();
                String[] host = s.split(":");

                if (log.isLoggable(Level.FINE)) {
                    log.fine(" Connecting to elasticsearch host. [" + host[0] + ":" + host[1] + "]");
                }

                client = ((TransportClient)client).addTransportAddress(new InetSocketTransportAddress(host[0],
                        new Integer(host[1])));
            }
        }
    }
952828
private void registerSchemas(Configuration conf, SchemaManager schemaManager)
      throws InterruptedException {
    HBaseAdmin admin;
    try {
      // Construct an HBaseAdmin object (required by schema tool), and delete it
      // if it exists so we start fresh.
      admin = new HBaseAdmin(conf);
      if (admin.tableExists("kite_example_user_profiles")) {
        admin.disableTable("kite_example_user_profiles");
        admin.deleteTable("kite_example_user_profiles");
      }
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    // Use the SchemaTool to create the schemas that are in the example-models
    // directory, and create the table and column families required by those
    // schemas.
    SchemaTool tool = new SchemaTool(admin, schemaManager);
    tool.createOrMigrateSchemaDirectory("classpath:example-models", true);
  }
512581
private void initialize(ComponentContext context,
                            Map<String, Object> properties, ConfigurationAdmin configAdmin)
                    throws InvalidFileStoreConfigurationException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, "initialize", new Object[] { context, properties });
        }
        this.properties = properties;
        this.bundleLocation = context.getBundleContext().getBundle().getLocation();
        
        // populate filestore
        SIBFileStore filestore = new SIBFileStoreImpl();
        populateFileStore(properties, filestore, configAdmin);

        // set bus properties
        // nothing to set for bus as only defaults are considered
        // uuid will be set by the processor
        SIBus bus = new SIBusImpl();

        // set the properties for mesagingengine object.first the queues or
        // topic is got from
        // Administration Config and list of SIBBestination is created
        // and then the localization list is created for those SIBdestination
        SIBMessagingEngine messagingEngine = new SIBMessagingEngineImpl();

        messagingEngine.setHighMessageThreshold((Long) properties
                        .get(JsAdminConstants.HIGHMESSAGETHRESHOLD));

        HashMap<String, BaseDestination> destinationList = new HashMap<String, BaseDestination>();
        HashMap<String, SIBLocalizationPoint> destinationLocalizationList = new HashMap<String, SIBLocalizationPoint>();

        // populate destinations of type QUEUE
        populateDestinations(properties, destinationList, destinationLocalizationList, messagingEngine.getName(), JsAdminConstants.QUEUE, configAdmin,
                             false);
        // populate destinations of type TOPICSPACE
        populateDestinations(properties, destinationList, destinationLocalizationList, messagingEngine.getName(), JsAdminConstants.TOPICSPACE, configAdmin,
                             false);
        //populate destinations of type ALIAS
        populateAliasDestinations(properties, destinationList, configAdmin);

        // processor will update the UUID via Admin.Since we dont get UUID info from server.xml
        messagingEngine.setDestinationList(destinationList);
        messagingEngine.setSibLocalizationPointList(destinationLocalizationList);

        // set all the constructed artifact to jsMEConfig
        jsMEConfig.setMessagingEngine(messagingEngine);
        jsMEConfig.setSIBFilestore(filestore);
        jsMEConfig.setSIBus(bus);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, "initialize");
        }

    }
340312
public function init()
    {
        if (empty($this->clientConfig['credentials'])) {
            throw new InvalidConfigException('Credentials are not set.');
        }

        if (empty($this->clientConfig['region'])) {
            throw new InvalidConfigException('Region is not set.');
        }

        if (empty($this->defaultBucket)) {
            throw new InvalidConfigException('Default bucket name is not set.');
        }

        foreach ($this->defaultComponentDefinitions() as $name => $definition) {
            $this->components[$name] = $this->components[$name] ?? $definition;
        }
    }
733658
function startApplication(appName, appDirectory, appList, configStore, sessionStore) {

    let path = appDirectory + '/' + appList[appName] + '/';
    let commonPath = appDirectory + '/apps/common/';
    let config = configStore[appName].get();
    let commonJsDir = commonPath + '/js/';
    let controllerJsDir = path + '/public/js/';

    if (config.isDaemon || config.serverMode === 'api') {
        controllerJsDir = path + '/js/';
    }

    let schema = JSON.parse((readFile(path + '/schema.json') || readFile(commonPath + '/schema.json')).toString());

    let controllerPath = (config.controller || 'controller.js');
    let matches = controllerPath.match(/(.*?)([0-9A-Za-z_]*)\.js$/);
    let prefix = matches[1];
    let prop = matches[2];

    // TODO: Completely change how we do configurations
    config.nconf = configStore[appName]; // Global config
    config.configStore = configStore;

    return setUpInjectObjectTemplate(appName, config, schema)
        .then(buildAppConfigAndLoadTemplates.bind(this, appName, config, controllerJsDir, commonJsDir, sessionStore))
        .spread(finishDaemonIfNeeded.bind(this, config, prop, prefix, appName));
}
501710
function initCustomComponents() {
    if (typeof projectConfig.crux.components !== 'string') {
      return false;
    }
    var componentPath = path.normalize(global['__rootdir'] + '/' + projectConfig.crux.components + '/'),
      componentList;
    try {
      componentList = util.readDirectoryRelative(componentPath, 'directory', null, true);
    } catch (e) {
      // there are no app components.
      return false;
    }
    var self = this;
    _.forEach(componentList, function(compName) {
      if (self.__components.indexOf('custom:' + compName) === -1) return;
      try {
        var CompClass = require(path.normalize(componentPath + '/' + compName + '/index.js'));
      } catch (e) {
        console.log(e);
        if (e.message.indexOf('Cannot find module') !== -1 && e.message.indexOf('index.js') !== -1) {
          log.warn('Crux.application: Custom component "%s" does not have index.js. Skipping...', compName);
          return;
        }
        e.message = "[Crux.customComponent: " + compName + "] " + e.message;
        throw e;
      }
      if (typeof CompClass !== 'function' || CompClass.prototype.__type !== 'CruxComponent') {
        throw new Error('[Crux.run()] Crux custom component "' + compName + '" does not extend Crux.Component');
      }
      var compConfig = getComponentConfiguration(compName);
      var compObj = new CompClass(compConfig, appConfig);
      if (compObj.name === 'CruxComponent') {
        compObj.name = compName;
      }
      registryObj.register(compObj);
      compObj.registry(registryObj);
    });
  }
953096
final static void init() {
		StopWatch stopWatch = new StopWatch();
		stopWatch.start("Audit4jInit");
		if (configContext == null) {
			configContext = new ConcurrentConfigurationContext();
		}

		if (lifeCycle.getStatus().equals(RunStatus.READY) || lifeCycle.getStatus().equals(RunStatus.STOPPED)) {
			Audit4jBanner banner = new Audit4jBanner();
			banner.printBanner();
			Log.info("Initializing Audit4j...");
			
			// Check system environment;
			checkEnvironment();
			
			// Load configurations to Memory
			Log.info("Loading Configurations...");
			if (conf == null) {
				loadConfig();
			}
			Log.info("Validating Configurations...");
			if (conf == null) {
				terminate();
				throw new InitializationException(INIT_FAILED);
			}
			try {
				ValidationManager.validateConfigurations(conf);
			} catch (ValidationException e1) {
				terminate();
				throw new InitializationException(INIT_FAILED, e1);
			}

			// Execute commands.
			CommandProcessor.getInstance().process(conf.getCommands());

			// Load Registry configurations.
			loadRegistry();

			if (conf.getProperties() == null) {
				conf.setProperties(new HashMap<String, String>());
			} else {
				for (Map.Entry<String, String> entry : conf.getProperties().entrySet()) {
					if (System.getProperties().containsKey(entry.getValue())) {
						conf.getProperties().put(entry.getKey(), System.getProperty(entry.getValue()));
					}
				}
			}
			configContext.getProperties().putAll(conf.getProperties());

			// Initialize handlers.
			initHandlers();

			// Initialize layouts.
			initLayout();

			// Initialize annotation transformer.

			if (conf.getAnnotationTransformer() == null) {
				annotationTransformer = getDefaultAnnotationTransformer();
			} else {
				annotationTransformer = conf.getAnnotationTransformer();
			}

			// Initialize IO streams.
			initStreams();

			if (!conf.getFilters().isEmpty()) {
			    Log.info("Registoring Filters...");
            }
			for (AuditEventFilter filter : conf.getFilters()) {
				configContext.addFilter(filter);
				Log.info(filter.getClass().getName() +  " Registored...");
			}

			configContext.setMetaData(conf.getMetaData());

			// Execute Scheduler tasks.
			Log.info("Executing Schedulers...");
			Schedulers.taskRegistry().scheduleAll();

			// Initialize monitoring support if available in the configurations.
			if (conf.getJmx() != null) {
				MBeanAgent agent = new MBeanAgent();
				agent.setJmxConfig(conf.getJmx());
				agent.init();
				agent.registerMbeans();
			}

			lifeCycle.setStatus(RunStatus.RUNNING);
			lifeCycle.setStartUpTime(new Date().getTime());
			stopWatch.stop();
			Long initializationTime = stopWatch.getLastTaskTimeMillis();
			Log.info("Audit4j initialized. Total time: ", initializationTime, "ms");
		}
	}
513886
public void start()
   {
      // responsible for:
      // 1. reading parameters (such as repoWorkspaceName, repoPath) from
      // registryService (if present) or init params
      // 2. initializing artifact service Registry Entry if registryService is
      // present
      // if Entry is not initialized yet (first launch)
      // 3. initializing maven root if not initialized

      if (LOG.isDebugEnabled())
      {
         LOG.debug("Starting ArtifactManagingService ...");
      }

      sessionProvider = SessionProvider.createSystemProvider();

      try
      {
         InputStream xml = getClass().getResourceAsStream(NT_FILE);
         ManageableRepository rep = repositoryService.getCurrentRepository();
         rep.getNodeTypeManager().registerNodeTypes(xml, ExtendedNodeTypeManager.IGNORE_IF_EXISTS,
            NodeTypeDataManager.TEXT_XML);
         readParamsFromRegistryService(sessionProvider);
         prepareRootNode(sessionProvider, rootNodePath);
      }
      catch (PathNotFoundException e)
      {
         try
         {
            readParamsFromFile();
            writeParamsToRegistryService(sessionProvider);

            prepareRootNode(sessionProvider, rootNodePath);
         }
         catch (RepositoryException exc)
         {
            LOG.error("Cannot write init configuration to RegistryService", exc);
         }
         catch (IOException exc)
         {
            LOG.error("Cannot write init configuration to RegistryService", exc);
         }
         catch (SAXException exc)
         {
            LOG.error("Cannot write init configuration to RegistryService", exc);
         }
         catch (ParserConfigurationException exc)
         {
            LOG.error("Cannot write init configuration to RegistryService", exc);
         }
      }
      catch (RepositoryException e)
      {
         LOG.error("Error while register nodetypes/checking existance", e);
      }
      finally
      {
         sessionProvider.close();
      }
   }
974787
@Override
    void start() throws InitializationException {
        if (hsqlServer == null) {
            hsqlServer = new Server();
            hsqlServer.setLogWriter(null);
            hsqlServer.setSilent(true);
            hsqlServer.setDatabaseName(0, EMBEDED_DB_NAME);
            hsqlServer.setDatabasePath(0, "file:" + EMBEDED_DB_FILE_NAME + ";user=" + getUname() + ";password="
                    + getPassword());
            hsqlServer.start();
        }
    }
481342
private void initAST() {
    jsRoot = IR.root();
    externsRoot = IR.root();
    externAndJsRoot = IR.root(externsRoot, jsRoot);
  }
437575
def _setup(app, *, schema,  title=None, app_key=APP_KEY, db=None):
    """"""

    admin = web.Application(loop=app.loop)
    app[app_key] = admin
    loader = jinja2.FileSystemLoader([TEMPLATES_ROOT, ])
    aiohttp_jinja2.setup(admin, loader=loader, app_key=TEMPLATE_APP_KEY)

    if title:
        schema.title = title

    resources = [
        init(db, info['table'], url=info['url'])
        for init, info in schema.resources
    ]

    admin_handler = AdminOnRestHandler(
        admin,
        resources=resources,
        loop=app.loop,
        schema=schema,
    )

    admin['admin_handler'] = admin_handler
    setup_admin_on_rest_handlers(admin, admin_handler)

    return admin
726886
@Override
    public void dropSchema()
    {
        for (TableInfo tableInfo : tableInfos)
        {
            try
            {
                client.deleteTable(tableInfo.getTableName());
            }
            catch (Exception ex)
            {
                logger.error("Error during deleting tables in kudu, Caused by: ", ex);
                throw new SchemaGenerationException(ex, "Kudu");
            }
        }
    }
121888
private function setup()
    {
        $manager = $this->getConnection()->getSchemaManager();
        if ($this->tablesExist === true || $manager->tablesExist([$this->options['db_table']]) === true) {
            $this->tablesExist = true;

            return;
        }

        $schema = new Schema();
        $table = $schema->createTable($this->options['db_table']);

        $table->addColumn($this->options['db_column_feature'], 'string', ['length' => 255]);
        $table->addColumn($this->options['db_column_state'], 'boolean');

        $table->setPrimaryKey([$this->options['db_column_feature']]);

        $platform = $this->getConnection()->getDatabasePlatform();
        $queries = $schema->toSql($platform);

        foreach ($queries as $query) {
            $this->getConnection()->executeQuery($query);
        }

        $this->tablesExist = true;
    }
1331429
private void init() {
    host = DEFAULT_HOST;
    port = DEFAULT_PORT;
    database = DEFAULT_DATABASE;
    user = DEFAULT_USER;
    password = DEFAULT_PASSWORD;
    cachePreparedStatements = DEFAULT_CACHE_PREPARED_STATEMENTS;
    pipeliningLimit = DEFAULT_PIPELINING_LIMIT;
    sslMode = DEFAULT_SSLMODE;
  }
51643
private void setUp() throws Exception {
    try {
      fileSystem = (DistributedFileSystem) FileSystem.get(
          StorageServiceConfigKeys.translateToOldSchema(conf, nameserviceId), conf);
      InetSocketAddress nameNodeAddr = fileSystem.getClient().getNameNodeAddr();
      metaInfo = new RequestMetaInfo(clusterId, nameserviceId, RequestMetaInfo.NO_NAMESPACE_ID,
          RequestMetaInfo.NO_APPLICATION_ID, (UnixUserGroupInformation) UserGroupInformation.getUGI(
          this.conf));

      directClientProtocol = RPC.getProxy(ClientProtocol.class, ClientProtocol.versionID,
          nameNodeAddr, conf);

      directClientProxyProtocol = RPC.getProxy(ClientProxyProtocol.class,
          ClientProxyProtocol.versionID, nameNodeAddr, conf);

      clientManager = new ThriftClientManager();
      FramedClientConnector connector = new FramedClientConnector(HostAndPort.fromParts(
          proxyHostname, proxyPortThrift));
      proxyTClientProxyProtocol = clientManager.createClient(connector, TClientProxyProtocol.class)
          .get();

      proxyClientProxyProtocol = RPC.getProxy(ClientProxyProtocol.class,
          ClientProxyProtocol.versionID, new InetSocketAddress(proxyHostname, proxyPortRPC), conf);

      fileSystem.mkdirs(new Path(ROOT));
    } catch (Exception e) {
      tearDown();
      throw e;
    }
  }
1278682
def init(context, reset, force):
    """"""
    store = Store(context.obj['database'], context.obj['root'])
    existing_tables = store.engine.table_names()
    if force or reset:
        if existing_tables and not force:
            message = f"Delete existing tables? [{', '.join(existing_tables)}]"
            click.confirm(click.style(message, fg='yellow'), abort=True)
        store.drop_all()
    elif existing_tables:
        click.echo(click.style("Database already exists, use '--reset'", fg='red'))
        context.abort()

    store.create_all()
    message = f"Success! New tables: {', '.join(store.engine.table_names())}"
    click.echo(click.style(message, fg='green'))