Open a CouchbaseManager.
It does nothing if a CouchbaseManager has already been opened.
@throws Exception if open fails
@throws InvalidConfigException
169106
public function openManager()
    {
        if ($this->manager !== null) {
            return;
        }

        if ($this->cluster === null) {
            $this->open();
        }

        if (empty($this->userName) || empty($this->password)) {
            throw new InvalidConfigException($this->className() . '::userName/password cannot be empty.');
        }

        $token = 'Opening CouchbaseManager: ' . $this->userName;

        try {
            Yii::trace($token, __METHOD__);
            Yii::beginProfile($token, __METHOD__);

            $this->manager = $this->cluster->manager($this->userName, $this->password);

            Yii::endProfile($token, __METHOD__);
        }
        catch (\Exception $e) {
            Yii::endProfile($token, __METHOD__);

            throw new Exception($e->getMessage(), (int)$e->getCode(), $e);
        }
    }
638339
public void configureWebApp() throws Exception
    {
        //cannot configure if the context is already started
        if (_context.isStarted())
        {
            if (log.isDebugEnabled()){log.debug("Cannot configure webapp after it is started");};
            return;
        }
        
        Resource webInf=getWebApplicationContext().getWebInf();
        // handle any WEB-INF descriptors
        if(webInf!=null&&webInf.isDirectory())
        {
            // do web.xml file
            Resource web=webInf.addPath("web.xml");
            if(!web.exists())
            {
                log.info("No WEB-INF/web.xml in "+getWebApplicationContext().getWAR()
                        +". Serving files and default/dynamic servlets only");
            }
            else
            {
                XmlParser.Node config=null;
                config=xmlParser.parse(web.getURL());
                initialize(config);
            }
        }
    }
754800
@Override
	public void afterPropertiesSet() throws Exception {
		if (couchDBProperties != null) {
			new DirectFieldAccessor(this).setPropertyValues(couchDBProperties);
		}
		LOG.info("Starting couchDb connector on {}:{}...",  new Object[]{host,port});
		LOG.debug("host: {}", host);
		LOG.debug("port: {}", port);
		LOG.debug("url: {}", url);
		LOG.debug("maxConnections: {}", maxConnections);
		LOG.debug("connectionTimeout: {}", connectionTimeout);
		LOG.debug("socketTimeout: {}", socketTimeout);
		LOG.debug("autoUpdateViewOnChange: {}", autoUpdateViewOnChange);
		LOG.debug("testConnectionAtStartup: {}", testConnectionAtStartup);
		LOG.debug("cleanupIdleConnections: {}", cleanupIdleConnections);
		LOG.debug("enableSSL: {}", enableSSL);
		LOG.debug("relaxedSSLSettings: {}", relaxedSSLSettings);
		LOG.debug("useExpectContinue: {}", useExpectContinue);

		
		client = new StdHttpClient.Builder()
								.host(host)
								.port(port)
								.maxConnections(maxConnections)
								.connectionTimeout(connectionTimeout)
								.socketTimeout(socketTimeout)
								.username(username)
								.password(password)
								.cleanupIdleConnections(cleanupIdleConnections)
								.useExpectContinue(useExpectContinue)
								.enableSSL(enableSSL)
								.relaxedSSLSettings(relaxedSSLSettings)
								.sslSocketFactory(sslSocketFactory)
								.caching(caching)
								.maxCacheEntries(maxCacheEntries)
								.maxObjectSizeBytes(maxObjectSizeBytes)
								.url(url)
								.build();
		
		if (testConnectionAtStartup) {
			testConnect(client);
		}
		
		configureAutoUpdateViewOnChange();
	}
106627
public void start() throws Exception{
		if(cleanupDirectory){
			CleanUp.start(conf);
		}
		IDatabaseDev db = (IDatabaseDev) em.getDB();//TODO make sure DB platform can be used for development
		ModelDefinitionProvider provider = new ModelDefinitionProvider(db, conf.dbUser, null, conf.includeSchema);
		ModelDef[] origModelList = provider.getTableDefinitions();
		
		new ModelMetaDataGenerator().start(origModelList, conf);
		//TODO: proper support for explicit ModelDefinitions
		ModelDef[] withExplecitList = overrideModelDefFromExplicit(origModelList, explicitMeta);
		ModelDef[] modelList = correctModelList(withExplecitList);
		
		new DAOClassGenerator().start(modelList, conf, true, false);
		new BeanGenerator().start(modelList, conf);
		new MapperGenerator().start(modelList, conf);

		ModelDef[] modelListOwned = setModelOwners(modelList, tableGroups);
		ModelDef[] modelListChilded = setDirectChildren(modelListOwned);

		new ColumnNameGenerator().start(modelListChilded, conf);
		new TableNameGenerator().start(modelListChilded, conf);
		new SchemaTableGenerator().start(modelListChilded, conf);
		new TableColumnGenerator().start(modelListChilded, conf);
		//new ModelMetaDataGenerator().start(modelListChilded, conf);
		
		new DAOInstanceFactoryGenerator().start(modelListChilded, conf);
		new ModelToDAOConversionGenerator().start(modelListChilded, conf);
	}
1124003
public function init(): void
    {
        parent::init();

        if (!($this->contentFS instanceof Filesystem)) {
            throw new InvalidConfigException(sprintf('ContentFS must be instance of %s.', Filesystem::class));
        }
        if (!($this->cacheFS instanceof Filesystem)) {
            throw new InvalidConfigException(sprintf('CacheFS must be instance of %s.', Filesystem::class));
        }

        $this->iconGenerator = IconGenerator::build($this->iconSet);
        $this->formatterFactory = new FormatterFactory((array) $this->formatterConfigArray);
        $this->aliasFactory = AliasFactory::build($this->defaultAlias);
        $this->aliasFactory->addMultiple($this->aliasArray);
    }
475916
@Override
    @Trivial
    public void open() throws ClassSource_Exception {
        String methodName = "open";
        if ( tc.isEntryEnabled() ) {
            String msg = MessageFormat.format(
                "[ {0} ] State [ {1} ]",
                new Object[] { getHashText(), Integer.valueOf(opens) });
            Tr.entry(tc, methodName, msg);
        }

        if ( (opens < 0) ||
             ((opens == 0) && (jarFile != null)) ||
             ((opens > 0) && (jarFile == null)) ) {

            Tr.warning(tc, "ANNO_CLASSSOURCE_JAR_STATE_BAD", getHashText(), getJarPath(), Integer.valueOf(opens));

            String eMsg = "[ " + getHashText() + " ]" +
                " Failed to open [ " + getJarPath() + " ]" +
                " Count of opens [ " + opens + " ]" +
                " Jar state [ " + jarFile + " ]";
            throw getFactory().newClassSourceException(eMsg);
        }

        opens++;

        if ( jarFile == null ) {
            try {
                jarFile = UtilImpl_FileUtils.createJarFile(jarPath); // throws IOException
            } catch ( IOException e ) {
                Tr.warning(tc, "ANNO_CLASSSOURCE_OPEN4_EXCEPTION", getHashText(), jarPath);
                String eMsg = "[ " + getHashText() + " ] Failed to open [ " + jarPath + " ]";
                throw getFactory().wrapIntoClassSourceException(CLASS_NAME, methodName, eMsg, e);
            }

            if ( tc.isEntryEnabled() ) {
                Tr.exit(tc, methodName, MessageFormat.format("[ {0} ] RETURN (new open)", getHashText()));
            }

        } else {
            if ( tc.isEntryEnabled() ) {
                Tr.exit(tc, methodName, MessageFormat.format("[ {0} ] RETURN (already open)", getHashText()));
            }
        }
    }
760712
public void start() throws Exception {
        started = true;
        setLogFileDir(logFileDir);
        LOGGER.debug("Initiating transaction manager recovery");
        recovered = new HashMap<>();

        logger.open(null);

        ReplayListener replayListener = new GeronimoReplayListener(xidFactory, recovered);
        logger.replayActiveTx(replayListener);

        LOGGER.debug("In doubt transactions recovered from log");
    }
915141
public function init()
    {
        NestableAsset::register($this->getView());
        if ($this->dataProvider !== null) {
            $this->prepareItems();
        }
        if ($this->items === null) {
            throw new InvalidConfigException('The "dataProvider" property or "items" property must be set at least one.');
        }
        Html::addCssClass($this->options, $this->rootClass);

        if (!ArrayHelper::keyExists('id', $this->options)) {
            $this->options['id'] = uniqid('w_');
        }

    }
177919
private void startInteractiveConfWizard() throws IOException {
        BufferedReader br = null;
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            System.out.println("");
            chooseBootstrapPack(br);
            chooseSampleSqlAndConf(br);
            enterAppName(br);
            enterPackageName(br);
        } finally {
            br.close();
        }
    }
398104
public function init()
    {
        if ($this->dataProvider === null) {
            throw new InvalidConfigException('The "dataProvider" property must be set.');
        }
        if ($this->emptyText === null) {
            $this->emptyText = Yii::t('yii', 'No results found.');
        }
        if (!isset($this->options['id'])) {
            $this->options['id'] = $this->getId();
        }
    }
820858
public synchronized void open() throws SFException, SnowflakeSQLException
  {
    performSanityCheckOnProperties();

    Boolean insecureMode = (Boolean) connectionPropertiesMap.get(
        SFSessionProperty.INSECURE_MODE);

    HttpUtil.configureCustomProxyProperties(connectionPropertiesMap);

    HttpUtil.initHttpClient(insecureMode != null ? insecureMode : false, null);

    logger.debug(
        "input: server={}, account={}, user={}, password={}, role={}, " +
        "database={}, schema={}, warehouse={}, authenticator={}, insecure_mode={}, " +
        "passcode_in_passward={}, passcode={}, private_key={}, " +
        "use_proxy={}, proxy_host={}, proxy_port={}, proxy_user={}, proxy_password={}, disable_socks_proxy={}, " +
        "application={}, app_id={}, app_version={}, " +
        "login_timeout={}, network_timeout={}, query_timeout={}, tracing={}",
        connectionPropertiesMap.get(SFSessionProperty.SERVER_URL),
        connectionPropertiesMap.get(SFSessionProperty.ACCOUNT),
        connectionPropertiesMap.get(SFSessionProperty.USER),
        !Strings.isNullOrEmpty((String) connectionPropertiesMap.get(SFSessionProperty.PASSWORD)) ? "***" : "(empty)",
        connectionPropertiesMap.get(SFSessionProperty.ROLE),
        connectionPropertiesMap.get(SFSessionProperty.DATABASE),
        connectionPropertiesMap.get(SFSessionProperty.SCHEMA),
        connectionPropertiesMap.get(SFSessionProperty.WAREHOUSE),
        connectionPropertiesMap.get(SFSessionProperty.AUTHENTICATOR),

        connectionPropertiesMap.get(SFSessionProperty.INSECURE_MODE),
        connectionPropertiesMap.get(SFSessionProperty.PASSCODE_IN_PASSWORD),
        !Strings.isNullOrEmpty((String) connectionPropertiesMap.get(SFSessionProperty.PASSCODE)) ? "***" : "(empty)",

        connectionPropertiesMap.get(SFSessionProperty.PRIVATE_KEY) != null ? "(not null)" : "(null)",

        connectionPropertiesMap.get(SFSessionProperty.USE_PROXY),
        connectionPropertiesMap.get(SFSessionProperty.PROXY_HOST),
        connectionPropertiesMap.get(SFSessionProperty.PROXY_PORT),
        connectionPropertiesMap.get(SFSessionProperty.PROXY_USER),
        !Strings.isNullOrEmpty((String) connectionPropertiesMap.get(SFSessionProperty.PROXY_PASSWORD)) ? "***" :
        "(empty)",
        connectionPropertiesMap.get(SFSessionProperty.DISABLE_SOCKS_PROXY),

        connectionPropertiesMap.get(SFSessionProperty.APPLICATION),
        connectionPropertiesMap.get(SFSessionProperty.APP_ID),
        connectionPropertiesMap.get(SFSessionProperty.APP_VERSION),

        connectionPropertiesMap.get(SFSessionProperty.LOGIN_TIMEOUT),
        connectionPropertiesMap.get(SFSessionProperty.NETWORK_TIMEOUT),
        connectionPropertiesMap.get(SFSessionProperty.QUERY_TIMEOUT),
        connectionPropertiesMap.get(SFSessionProperty.TRACING)
    );
    SessionUtil.LoginInput loginInput = new SessionUtil.LoginInput();
    loginInput.setServerUrl(
        (String) connectionPropertiesMap.get(SFSessionProperty.SERVER_URL))
        .setDatabaseName(
            (String) connectionPropertiesMap.get(SFSessionProperty.DATABASE))
        .setSchemaName(
            (String) connectionPropertiesMap.get(SFSessionProperty.SCHEMA))
        .setWarehouse(
            (String) connectionPropertiesMap.get(SFSessionProperty.WAREHOUSE))
        .setRole((String) connectionPropertiesMap.get(SFSessionProperty.ROLE))
        .setAuthenticator(
            (String) connectionPropertiesMap.get(SFSessionProperty.AUTHENTICATOR))
        .setAccountName(
            (String) connectionPropertiesMap.get(SFSessionProperty.ACCOUNT))
        .setLoginTimeout(loginTimeout)
        .setUserName(
            (String) connectionPropertiesMap.get(SFSessionProperty.USER))
        .setPassword(
            (String) connectionPropertiesMap.get(SFSessionProperty.PASSWORD))
        .setToken(
            (String) connectionPropertiesMap.get(SFSessionProperty.TOKEN))
        .setIdToken(
            (String) connectionPropertiesMap.get(SFSessionProperty.ID_TOKEN))
        .setClientInfo(this.getClientInfo())
        .setPasscodeInPassword(passcodeInPassword)
        .setPasscode(
            (String) connectionPropertiesMap.get(SFSessionProperty.PASSCODE))
        .setConnectionTimeout(httpClientConnectionTimeout)
        .setSocketTimeout(httpClientSocketTimeout)
        .setAppId((String) connectionPropertiesMap.get(SFSessionProperty.APP_ID))
        .setAppVersion(
            (String) connectionPropertiesMap.get(SFSessionProperty.APP_VERSION))
        .setSessionParameters(sessionParametersMap)
        .setPrivateKey((PrivateKey) connectionPropertiesMap.get(
            SFSessionProperty.PRIVATE_KEY))
        .setApplication((String) connectionPropertiesMap.get(
            SFSessionProperty.APPLICATION))
        .setServiceName(this.getServiceName());

    SessionUtil.LoginOutput loginOutput = SessionUtil.openSession(loginInput);
    isClosed = false;

    if (loginOutput.isUpdatedByTokenRequest())
    {
      setCurrentObjects(loginInput, loginOutput);
    }

    sessionToken = loginOutput.getSessionToken();
    masterToken = loginOutput.getMasterToken();
    idToken = loginOutput.getIdToken();
    databaseVersion = loginOutput.getDatabaseVersion();
    databaseMajorVersion = loginOutput.getDatabaseMajorVersion();
    databaseMinorVersion = loginOutput.getDatabaseMinorVersion();
    httpClientSocketTimeout = loginOutput.getHttpClientSocketTimeout();
    masterTokenValidityInSeconds = loginOutput.getMasterTokenValidityInSeconds();
    database = loginOutput.getSessionDatabase();
    schema = loginOutput.getSessionSchema();
    role = loginOutput.getSessionRole();
    warehouse = loginOutput.getSessionWarehouse();

    // Update common parameter values for this session
    SessionUtil.updateSfDriverParamValues(loginOutput.getCommonParams(), this);

    String loginDatabaseName = (String) connectionPropertiesMap.get(
        SFSessionProperty.DATABASE);
    String loginSchemaName = (String) connectionPropertiesMap.get(
        SFSessionProperty.SCHEMA);
    String loginRole = (String) connectionPropertiesMap.get(
        SFSessionProperty.ROLE);
    String loginWarehouse = (String) connectionPropertiesMap.get(
        SFSessionProperty.WAREHOUSE);

    if (loginDatabaseName != null && !loginDatabaseName
        .equalsIgnoreCase(database))
    {
      sqlWarnings.add(new SFException(ErrorCode
                                          .CONNECTION_ESTABLISHED_WITH_DIFFERENT_PROP,
                                      "Database", loginDatabaseName, database));
    }

    if (loginSchemaName != null && !loginSchemaName
        .equalsIgnoreCase(schema))
    {
      sqlWarnings.add(new SFException(ErrorCode.
                                          CONNECTION_ESTABLISHED_WITH_DIFFERENT_PROP,
                                      "Schema", loginSchemaName, schema));
    }

    if (loginRole != null && !loginRole
        .equalsIgnoreCase(role))
    {
      sqlWarnings.add(new SFException(ErrorCode.
                                          CONNECTION_ESTABLISHED_WITH_DIFFERENT_PROP,
                                      "Role", loginRole, role));
    }

    if (loginWarehouse != null && !loginWarehouse
        .equalsIgnoreCase(warehouse))
    {
      sqlWarnings.add(new SFException(ErrorCode.
                                          CONNECTION_ESTABLISHED_WITH_DIFFERENT_PROP,
                                      "Warehouse", loginWarehouse, warehouse));
    }

    // start heartbeat for this session so that the master token will not expire
    startHeartbeatForThisSession();
  }
1051095
@PostConstruct
	protected void init() throws IOException {
		// base configuration from XML file
		if (null != configurationFile) {
			log.debug("Get base configuration from {}", configurationFile);
			manager = new DefaultCacheManager(configurationFile);
		} else {
			GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder();
			builder.globalJmxStatistics().allowDuplicateDomains(true);
			manager = new DefaultCacheManager(builder.build());
		}

		if (listener == null) {
			listener = new InfinispanCacheListener();
		}
		manager.addListener(listener);

		// cache for caching the cache configurations (hmmm, sounds a bit strange)
		Map<String, Map<CacheCategory, CacheService>> cacheCache = 
				new HashMap<String, Map<CacheCategory, CacheService>>();

		// build default configuration
		if (null != defaultConfiguration) {
			setCaches(cacheCache, null, defaultConfiguration);
		}

		// build layer specific configurations
		for (Layer layer : layerMap.values()) {
			CacheInfo ci = configurationService.getLayerExtraInfo(layer.getLayerInfo(), CacheInfo.class);
			if (null != ci) {
				setCaches(cacheCache, layer, ci);
			}
		}
	}
1134581
public void open() throws DBException
    {
        if (this.isOpen())
            return;         // Ignore if already open
        m_bIsOpen = false;
        this.getRecord().handleInitialKey();        // Set up the smaller key
        this.getRecord().handleEndKey();            // Set up the larger key
        this.doOpen();      // Now do the physical open in sub class.
        m_bIsOpen = true;
        m_iRecordStatus = DBConstants.RECORD_INVALID | DBConstants.RECORD_AT_BOF;
        if ((this.getRecord().getOpenMode() & DBConstants.OPEN_SUPPRESS_MESSAGES) == 0)
            this.getRecord().handleRecordChange(DBConstants.AFTER_REQUERY_TYPE);    // Notify listeners that a new table will be built
    }
822831
public function init()
    {
        foreach (static::defaultConfig() as $key => $value) {
            if (!isset($this->{$key})) {
                $this->{$key} = $value;
            }
        }
        foreach (static::requiredConfig() as $key) {
            if (!isset($this->{$key})) {
                throw new InvalidConfigException(get_class($this) . " key provider requires '{$key}' config key");
            }
        }
        KeyProviderCollector::internalRegisterProvider($this);
    }
109510
public function init()
    {
        if ($this->dataProvider === null) {
            throw new InvalidConfigException('The "dataProvider" property must be set.');
        }
        if ($this->emptyText === null) {
            $this->emptyText = Yii::t('yii', 'No results found.');
        }
        if (!isset($this->options['id'])) {
            $this->options['id'] = $this->getId();
        }

        if ($this->formatter == null) {
            $this->formatter = Yii::$app->getFormatter();
        } elseif (is_array($this->formatter)) {
            $this->formatter = Yii::createObject($this->formatter);
        }
        if (!$this->formatter instanceof Formatter) {
            throw new InvalidConfigException('The "formatter" property must be either a Format object or a configuration array.');
        }

        if (!$this->keyColumnName) {
            throw new InvalidConfigException('The "keyColumnName" property must be specified"');
        }
        if (!$this->parentColumnName) {
            throw new InvalidConfigException('The "parentColumnName" property must be specified"');
        }

        $this->initColumns();
    }
207743
public function open()
    {
        if ($this->activeNode !== null) {
            return;
        }
        if (empty($this->nodes)) {
            throw new InvalidConfigException('elasticsearch needs at least one node to operate.');
        }
        $this->_curl = curl_init();
        if ($this->autodetectCluster) {
            $this->populateNodes();
        }
        $this->selectActiveNode();
        Yii::trace('Opening connection to elasticsearch. Nodes in cluster: ' . count($this->nodes)
            . ', active node: ' . $this->nodes[$this->activeNode]['http_address'], __CLASS__);
        $this->initConnection();
    }
903491
public synchronized void open() throws IOException {
        if (tmap != null) {
            return;
        }
        final RecordManager rm = createRecordManager(indexPath);
        if (valueSerializer == null) {
            tmap = rm.treeMap(IndexerConstants.INDEX_TREE_KEY);
        } else {
            tmap = rm.treeMap(IndexerConstants.INDEX_TREE_KEY, valueSerializer);
        }
        if (tmap.isEmpty()) {
            rm.close();
            throw new IOException("tree map is empty");
        }
        invTmap = tmap.inverseHashView(IndexerConstants.INVERSE_KEY);
    }