use of org.neo4j.dbms.database.DefaultDatabaseInitializer in project neo4j by neo4j.
the class DatabaseManagementServiceFactory method build.
/**
* Instantiate a graph database given configuration, dependencies, and a custom implementation of {@link org
* .neo4j.kernel.impl.factory.GraphDatabaseFacade}.
*
* @param config configuration
* @param dependencies the dependencies required to construct the {@link GraphDatabaseFacade}
* @return the initialised {@link GraphDatabaseFacade}
*/
public DatabaseManagementService build(Config config, final ExternalDependencies dependencies) {
GlobalModule globalModule = createGlobalModule(config, dependencies);
AbstractEditionModule edition = editionFactory.apply(globalModule);
Dependencies globalDependencies = globalModule.getGlobalDependencies();
LifeSupport globalLife = globalModule.getGlobalLife();
LogService logService = globalModule.getLogService();
Log internalLog = logService.getInternalLog(getClass());
DatabaseManager<?> databaseManager = edition.createDatabaseManager(globalModule);
DatabaseManagementService managementService = createManagementService(globalModule, globalLife, internalLog, databaseManager);
globalDependencies.satisfyDependencies(managementService);
edition.bootstrapFabricServices();
setupProcedures(globalModule, edition, databaseManager);
edition.registerSystemGraphComponents(globalModule.getSystemGraphComponents(), globalModule);
globalLife.add(edition.createSystemGraphInitializer(globalModule));
var dbmsRuntimeSystemGraphComponent = new DbmsRuntimeSystemGraphComponent(globalModule.getGlobalConfig());
globalModule.getSystemGraphComponents().register(dbmsRuntimeSystemGraphComponent);
edition.createDefaultDatabaseResolver(globalModule);
globalDependencies.satisfyDependency(edition.getDefaultDatabaseResolver());
edition.createSecurityModule(globalModule);
SecurityProvider securityProvider = edition.getSecurityProvider();
globalDependencies.satisfyDependencies(securityProvider.authManager());
var dbmsRuntimeRepository = edition.createAndRegisterDbmsRuntimeRepository(globalModule, databaseManager, globalDependencies, dbmsRuntimeSystemGraphComponent);
globalDependencies.satisfyDependency(dbmsRuntimeRepository);
globalLife.add(new DefaultDatabaseInitializer(databaseManager));
globalLife.add(globalModule.getGlobalExtensions());
BoltGraphDatabaseManagementServiceSPI boltGraphDatabaseManagementServiceSPI = edition.createBoltDatabaseManagementServiceProvider(globalDependencies, managementService, globalModule.getGlobalMonitors(), globalModule.getGlobalClock(), logService);
globalLife.add(createBoltServer(globalModule, edition, boltGraphDatabaseManagementServiceSPI, databaseManager.databaseIdRepository()));
var webServer = createWebServer(edition, managementService, globalDependencies, config, globalModule.getLogService().getUserLogProvider());
globalDependencies.satisfyDependency(webServer);
globalLife.add(webServer);
globalLife.add(globalModule.getCapabilitiesService());
startDatabaseServer(globalModule, globalLife, internalLog, databaseManager, managementService);
return managementService;
}
Aggregations