use of org.neo4j.server.AbstractNeoServer in project neo4j by neo4j.
the class AbstractInProcessServerBuilder method newServer.
@Override
public ServerControls newServer() {
try (FileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction()) {
final OutputStream logOutputStream;
try {
logOutputStream = createOrOpenAsOuputStream(fileSystem, new File(serverFolder, "neo4j.log"), true);
} catch (IOException e) {
throw new RuntimeException("Unable to create log file", e);
}
config.put(ServerSettings.third_party_packages.name(), toStringForThirdPartyPackageProperty(extensions.toList()));
final FormattedLogProvider userLogProvider = FormattedLogProvider.toOutputStream(logOutputStream);
GraphDatabaseDependencies dependencies = GraphDatabaseDependencies.newDependencies();
Iterable<KernelExtensionFactory<?>> kernelExtensions = append(new Neo4jHarnessExtensions(procedures), dependencies.kernelExtensions());
dependencies = dependencies.kernelExtensions(kernelExtensions).userLogProvider(userLogProvider);
AbstractNeoServer neoServer = createNeoServer(config, dependencies, userLogProvider);
InProcessServerControls controls = new InProcessServerControls(serverFolder, neoServer, logOutputStream);
controls.start();
try {
fixtures.applyTo(controls);
} catch (Exception e) {
controls.close();
throw Exceptions.launderedException(e);
}
return controls;
} catch (IOException e) {
throw Exceptions.launderedException(e);
}
}
Aggregations