Search in sources :

Example 1 with SPIPluginLifecycle

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;
}
Also used : Injectable(org.neo4j.server.plugins.Injectable) SPIPluginLifecycle(org.neo4j.server.plugins.SPIPluginLifecycle) PluginLifecycle(org.neo4j.server.plugins.PluginLifecycle) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) ConfigAdapter(org.neo4j.server.plugins.ConfigAdapter) Config(org.neo4j.kernel.configuration.Config) SPIPluginLifecycle(org.neo4j.server.plugins.SPIPluginLifecycle) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 Config (org.neo4j.kernel.configuration.Config)1 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)1 ConfigAdapter (org.neo4j.server.plugins.ConfigAdapter)1 Injectable (org.neo4j.server.plugins.Injectable)1 PluginLifecycle (org.neo4j.server.plugins.PluginLifecycle)1 SPIPluginLifecycle (org.neo4j.server.plugins.SPIPluginLifecycle)1