Search in sources :

Example 1 with DoubleProperties

use of org.apache.derby.iapi.util.DoubleProperties in project derby by apache.

the class BasicDatabase method boot.

public void boot(boolean create, Properties startParams) throws StandardException {
    ModuleFactory monitor = getMonitor();
    if (create) {
        if (startParams.getProperty(Property.CREATE_WITH_NO_LOG) == null)
            startParams.put(Property.CREATE_WITH_NO_LOG, "true");
        String localeID = startParams.getProperty(org.apache.derby.shared.common.reference.Attribute.TERRITORY);
        if (localeID == null) {
            localeID = Locale.getDefault().toString();
        }
        databaseLocale = monitor.setLocale(startParams, localeID);
    } else {
        databaseLocale = monitor.getLocale(this);
    }
    setLocale(databaseLocale);
    // boot the validation needed to do property validation, now property
    // validation is separated from AccessFactory, therefore from store
    bootValidation(create, startParams);
    // boot the type factory before store to ensure any dynamically
    // registered types (DECIMAL) are there before logical undo recovery
    // might need them.
    DataValueFactory dvf = (DataValueFactory) bootServiceModule(create, this, org.apache.derby.shared.common.reference.ClassName.DataValueFactory, startParams);
    bootStore(create, startParams);
    // create a database ID if one doesn't already exist
    myUUID = makeDatabaseID(create, startParams);
    // Add the database properties read from disk (not stored
    // in service.properties) into the set seen by booting modules.
    Properties allParams = new DoubleProperties(getAllDatabaseProperties(), startParams);
    if (pf != null)
        pf.addPropertySetNotification(this);
    // Boot the ClassFactory, will be per-database or per-system.
    // reget the tc in case someone inadverdently destroyed it
    bootClassFactory(create, allParams);
    dd = (DataDictionary) bootServiceModule(create, this, DataDictionary.MODULE, allParams);
    lcf = (LanguageConnectionFactory) bootServiceModule(create, this, LanguageConnectionFactory.MODULE, allParams);
    lf = (LanguageFactory) bootServiceModule(create, this, LanguageFactory.MODULE, allParams);
    bootResourceAdapter(create, allParams);
    // may also want to set up a check that we are a singleton,
    // or that there isn't already a database object in the system
    // for the same database?
    // 
    // We boot the authentication service. There should at least be one
    // per database (even if authentication is turned off) .
    // 
    authenticationService = bootAuthenticationService(create, allParams);
    if (SanityManager.DEBUG) {
        SanityManager.ASSERT(authenticationService != null, "Failed to set the Authentication service for the database");
    }
    // on logging
    if (create && lastToBoot && (startParams.getProperty(Property.CREATE_WITH_NO_LOG) != null)) {
        createFinished();
    }
    active = true;
    // Create an index statistics update daemon.
    if (dd.doCreateIndexStatsRefresher()) {
        dd.createIndexStatsRefresher(this, allParams.getProperty(Property.PROPERTY_RUNTIME_PREFIX + "serviceDirectory"));
    }
}
Also used : ModuleFactory(org.apache.derby.iapi.services.monitor.ModuleFactory) DoubleProperties(org.apache.derby.iapi.util.DoubleProperties) DataValueFactory(org.apache.derby.iapi.types.DataValueFactory) Properties(java.util.Properties) DoubleProperties(org.apache.derby.iapi.util.DoubleProperties)

Aggregations

Properties (java.util.Properties)1 ModuleFactory (org.apache.derby.iapi.services.monitor.ModuleFactory)1 DataValueFactory (org.apache.derby.iapi.types.DataValueFactory)1 DoubleProperties (org.apache.derby.iapi.util.DoubleProperties)1