Logging.start(configuration.getDebugLevel());
/*
* allocate and preload BabuDB
*/
BabuDBInternal babuDB = new BabuDBImpl(configuration);
Logging.logMessage(Logging.LEVEL_INFO, babuDB, "BabuDB %s", BABUDB_VERSION);
Logging.logMessage(Logging.LEVEL_INFO, babuDB, "\n%s", configuration.toString());
/*
* run automatic database conversion if necessary
*/
if (babuDB.getDBConfigFile().isConversionRequired()) {
Logging.logMessage(Logging.LEVEL_WARN, Category.storage, babuDB,
"The database version is outdated. The database will be "
+ "automatically converted to the latest version if "
+ "possible. This may take some time, depending on the " + "size.");
AutoConverter.initiateConversion(babuDB.getDBConfigFile().getDBFormatVersion(), configuration);
}
/*
* load the optional plugins
*/
try {
babuDB = PluginLoader.init(babuDB);
} catch (IOException e) {
if (e.getMessage() == null)
Logging.logError(Logging.LEVEL_ERROR, babuDB, e);
throw new BabuDBException(ErrorCode.BROKEN_PLUGIN, e.getMessage(), e.getCause());
}
/*
* initialize all services provided
*/
babuDB.init(staticInit);
return babuDB;
}