use of org.neo4j.server.plugins.SPIPluginLifecycle in project neo4j by neo4j.
the class ExtensionInitializer method initializePackages.
public Collection<Injectable<?>> initializePackages(Iterable<String> packageNames) {
GraphDatabaseAPI graphDatabaseService = neoServer.getDatabase().getGraph();
Config configuration = neoServer.getConfig();
Collection<Injectable<?>> injectables = new HashSet<>();
for (PluginLifecycle lifecycle : lifecycles) {
if (hasPackage(lifecycle, packageNames)) {
if (lifecycle instanceof SPIPluginLifecycle) {
SPIPluginLifecycle lifeCycleSpi = (SPIPluginLifecycle) lifecycle;
injectables.addAll(lifeCycleSpi.start(neoServer));
} else {
injectables.addAll(lifecycle.start(graphDatabaseService, new ConfigAdapter(configuration)));
}
}
}
return injectables;
}
Aggregations