use of org.neo4j.dbms.database.DatabaseManagementServiceImpl in project neo4j by neo4j.
the class TestFabricDatabaseManagementServiceFactory method createManagementService.
@Override
protected DatabaseManagementService createManagementService(GlobalModule globalModule, LifeSupport globalLife, Log internalLog, DatabaseManager<?> databaseManager) {
return new DatabaseManagementServiceImpl(databaseManager, globalModule.getGlobalAvailabilityGuard(), globalLife, globalModule.getDatabaseEventListeners(), globalModule.getTransactionEventListeners(), internalLog, globalModule.getGlobalConfig()) {
@Override
public GraphDatabaseService database(String name) throws DatabaseNotFoundException {
BoltFabricDatabaseManagementService fabricBoltDbms = globalModule.getGlobalDependencies().resolveDependency(BoltFabricDatabaseManagementService.class);
var baseDb = databaseManager.getDatabaseContext(name).orElseThrow(() -> new DatabaseNotFoundException(name)).databaseFacade();
// Therefore the lookup of Bolt API representation of a database has to be done lazily.
return new TestFabricGraphDatabaseService(baseDb, config, () -> {
try {
return fabricBoltDbms.getDatabase(name, EmptyMemoryTracker.INSTANCE);
} catch (UnavailableException e) {
throw new RuntimeException(e);
}
});
}
};
}
Aggregations