Search in sources :

Example 1 with TransactionFacade

use of org.neo4j.server.rest.transactional.TransactionFacade in project neo4j by neo4j.

the class AbstractNeoServer method createDefaultInjectables.

protected Collection<InjectableProvider<?>> createDefaultInjectables() {
    Collection<InjectableProvider<?>> singletons = new ArrayList<>();
    Database database = getDatabase();
    singletons.add(new DatabaseProvider(database));
    singletons.add(new DatabaseActions.Provider(databaseActions));
    singletons.add(new GraphDatabaseServiceProvider(database));
    singletons.add(new NeoServerProvider(this));
    singletons.add(providerForSingleton(new ConfigAdapter(getConfig()), Configuration.class));
    singletons.add(providerForSingleton(getConfig(), Config.class));
    singletons.add(new WebServerProvider(getWebServer()));
    PluginInvocatorProvider pluginInvocatorProvider = new PluginInvocatorProvider(this);
    singletons.add(pluginInvocatorProvider);
    RepresentationFormatRepository repository = new RepresentationFormatRepository(this);
    singletons.add(new InputFormatProvider(repository));
    singletons.add(new OutputFormatProvider(repository));
    singletons.add(new CypherExecutorProvider(cypherExecutor));
    singletons.add(providerForSingleton(transactionFacade, TransactionFacade.class));
    singletons.add(providerFromSupplier(authManagerSupplier, AuthManager.class));
    singletons.add(providerFromSupplier(userManagerSupplier, UserManagerSupplier.class));
    singletons.add(new TransactionFilter(database));
    singletons.add(new LoggingProvider(logProvider));
    singletons.add(providerForSingleton(logProvider.getLog(NeoServer.class), Log.class));
    singletons.add(providerForSingleton(resolveDependency(UsageData.class), UsageData.class));
    return singletons;
}
Also used : DatabaseProvider(org.neo4j.server.database.DatabaseProvider) PluginInvocatorProvider(org.neo4j.server.plugins.PluginInvocatorProvider) TransactionFilter(org.neo4j.server.rest.transactional.TransactionFilter) CypherExecutorProvider(org.neo4j.server.database.CypherExecutorProvider) Configuration(org.apache.commons.configuration.Configuration) UsageData(org.neo4j.udc.UsageData) Config(org.neo4j.kernel.configuration.Config) ArrayList(java.util.ArrayList) UserManagerSupplier(org.neo4j.kernel.api.security.UserManagerSupplier) DatabaseActions(org.neo4j.server.rest.web.DatabaseActions) Database(org.neo4j.server.database.Database) InjectableProvider(org.neo4j.server.database.InjectableProvider) OutputFormatProvider(org.neo4j.server.rest.repr.OutputFormatProvider) InputFormatProvider(org.neo4j.server.rest.repr.InputFormatProvider) ConfigAdapter(org.neo4j.server.plugins.ConfigAdapter) AuthManager(org.neo4j.kernel.api.security.AuthManager) Log(org.neo4j.logging.Log) AsyncRequestLog(org.neo4j.server.web.AsyncRequestLog) TransactionFacade(org.neo4j.server.rest.transactional.TransactionFacade) GraphDatabaseServiceProvider(org.neo4j.server.database.GraphDatabaseServiceProvider) RepresentationFormatRepository(org.neo4j.server.rest.repr.RepresentationFormatRepository) WebServerProvider(org.neo4j.server.web.WebServerProvider)

Example 2 with TransactionFacade

use of org.neo4j.server.rest.transactional.TransactionFacade in project neo4j by neo4j.

the class AbstractNeoServer method createTransactionalActions.

private TransactionFacade createTransactionalActions() {
    final long timeoutMillis = getTransactionTimeoutMillis();
    final Clock clock = Clocks.systemClock();
    transactionRegistry = new TransactionHandleRegistry(clock, timeoutMillis, logProvider);
    // ensure that this is > 0
    long runEvery = round(timeoutMillis / 2.0);
    resolveDependency(JobScheduler.class).scheduleRecurring(serverTransactionTimeout, () -> {
        long maxAge = clock.millis() - timeoutMillis;
        transactionRegistry.rollbackSuspendedTransactionsIdleSince(maxAge);
    }, runEvery, MILLISECONDS);
    DependencyResolver dependencyResolver = database.getGraph().getDependencyResolver();
    return new TransactionFacade(new TransitionalPeriodTransactionMessContainer(database.getGraph()), dependencyResolver.resolveDependency(QueryExecutionEngine.class), dependencyResolver.resolveDependency(GraphDatabaseQueryService.class), transactionRegistry, logProvider);
}
Also used : JobScheduler(org.neo4j.kernel.impl.util.JobScheduler) TransitionalPeriodTransactionMessContainer(org.neo4j.server.rest.transactional.TransitionalPeriodTransactionMessContainer) QueryExecutionEngine(org.neo4j.kernel.impl.query.QueryExecutionEngine) GraphDatabaseQueryService(org.neo4j.kernel.GraphDatabaseQueryService) TransactionFacade(org.neo4j.server.rest.transactional.TransactionFacade) TransactionHandleRegistry(org.neo4j.server.rest.transactional.TransactionHandleRegistry) Clock(java.time.Clock) DependencyResolver(org.neo4j.graphdb.DependencyResolver)

Aggregations

TransactionFacade (org.neo4j.server.rest.transactional.TransactionFacade)2 Clock (java.time.Clock)1 ArrayList (java.util.ArrayList)1 Configuration (org.apache.commons.configuration.Configuration)1 DependencyResolver (org.neo4j.graphdb.DependencyResolver)1 GraphDatabaseQueryService (org.neo4j.kernel.GraphDatabaseQueryService)1 AuthManager (org.neo4j.kernel.api.security.AuthManager)1 UserManagerSupplier (org.neo4j.kernel.api.security.UserManagerSupplier)1 Config (org.neo4j.kernel.configuration.Config)1 QueryExecutionEngine (org.neo4j.kernel.impl.query.QueryExecutionEngine)1 JobScheduler (org.neo4j.kernel.impl.util.JobScheduler)1 Log (org.neo4j.logging.Log)1 CypherExecutorProvider (org.neo4j.server.database.CypherExecutorProvider)1 Database (org.neo4j.server.database.Database)1 DatabaseProvider (org.neo4j.server.database.DatabaseProvider)1 GraphDatabaseServiceProvider (org.neo4j.server.database.GraphDatabaseServiceProvider)1 InjectableProvider (org.neo4j.server.database.InjectableProvider)1 ConfigAdapter (org.neo4j.server.plugins.ConfigAdapter)1 PluginInvocatorProvider (org.neo4j.server.plugins.PluginInvocatorProvider)1 InputFormatProvider (org.neo4j.server.rest.repr.InputFormatProvider)1