Search in sources :

Example 1 with RestCacheAdminModule

use of com.google.gerrit.server.config.RestCacheAdminModule in project gerrit by GerritCodeReview.

the class Daemon method createSysInjector.

private Injector createSysInjector() {
    final List<Module> modules = new ArrayList<>();
    modules.add(SchemaVersionCheck.module());
    modules.add(new DropWizardMetricMaker.RestModule());
    modules.add(new LogFileCompressor.Module());
    // Index module shutdown must happen before work queue shutdown, otherwise
    // work queue can get stuck waiting on index futures that will never return.
    modules.add(createIndexModule());
    modules.add(new WorkQueue.Module());
    modules.add(new StreamEventsApiListener.Module());
    modules.add(new EventBroker.Module());
    modules.add(test ? new H2AccountPatchReviewStore.InMemoryModule() : new JdbcAccountPatchReviewStore.Module(config));
    modules.add(new ReceiveCommitsExecutorModule());
    modules.add(new DiffExecutorModule());
    modules.add(new MimeUtil2Module());
    modules.add(cfgInjector.getInstance(GerritGlobalModule.class));
    modules.add(new SearchingChangeCacheImpl.Module(slave));
    modules.add(new InternalAccountDirectory.Module());
    modules.add(new DefaultPermissionBackendModule());
    modules.add(new DefaultCacheFactory.Module());
    modules.add(cfgInjector.getInstance(MailReceiver.Module.class));
    if (emailModule != null) {
        modules.add(emailModule);
    } else {
        modules.add(new SmtpEmailSender.Module());
    }
    modules.add(new SignedTokenEmailTokenVerifier.Module());
    modules.add(new PluginRestApiModule());
    modules.add(new RestCacheAdminModule());
    modules.add(new GpgModule(config));
    modules.add(new StartupChecks.Module());
    if (MoreObjects.firstNonNull(httpd, true)) {
        modules.add(new CanonicalWebUrlModule() {

            @Override
            protected Class<? extends Provider<String>> provider() {
                return HttpCanonicalWebUrlProvider.class;
            }
        });
    } else {
        modules.add(new CanonicalWebUrlModule() {

            @Override
            protected Class<? extends Provider<String>> provider() {
                return CanonicalWebUrlProvider.class;
            }
        });
    }
    if (sshd) {
        modules.add(SshKeyCacheImpl.module());
    } else {
        modules.add(NoSshKeyCache.module());
    }
    modules.add(new AbstractModule() {

        @Override
        protected void configure() {
            bind(GerritOptions.class).toInstance(new GerritOptions(config, headless, slave, polyGerritDev));
            if (test) {
                bind(String.class).annotatedWith(SecureStoreClassName.class).toInstance(DefaultSecureStore.class.getName());
                bind(SecureStore.class).toProvider(SecureStoreProvider.class);
            }
        }
    });
    modules.add(new GarbageCollectionModule());
    if (!slave) {
        modules.add(new ChangeCleanupRunner.Module());
    }
    return cfgInjector.createChildInjector(modules);
}
Also used : ArrayList(java.util.ArrayList) InternalAccountDirectory(com.google.gerrit.server.account.InternalAccountDirectory) WorkQueue(com.google.gerrit.server.git.WorkQueue) MimeUtil2Module(com.google.gerrit.server.mime.MimeUtil2Module) SignedTokenEmailTokenVerifier(com.google.gerrit.server.mail.SignedTokenEmailTokenVerifier) GerritGlobalModule(com.google.gerrit.server.config.GerritGlobalModule) StartupChecks(com.google.gerrit.server.StartupChecks) ChangeCleanupRunner(com.google.gerrit.server.change.ChangeCleanupRunner) GarbageCollectionModule(com.google.gerrit.server.git.GarbageCollectionModule) RestCacheAdminModule(com.google.gerrit.server.config.RestCacheAdminModule) DropWizardMetricMaker(com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker) GpgModule(com.google.gerrit.gpg.GpgModule) DefaultPermissionBackendModule(com.google.gerrit.server.project.DefaultPermissionBackendModule) EventBroker(com.google.gerrit.common.EventBroker) SearchingChangeCacheImpl(com.google.gerrit.server.git.SearchingChangeCacheImpl) PluginRestApiModule(com.google.gerrit.server.plugins.PluginRestApiModule) DefaultCacheFactory(com.google.gerrit.server.cache.h2.DefaultCacheFactory) GerritOptions(com.google.gerrit.server.config.GerritOptions) SecureStoreProvider(com.google.gerrit.server.securestore.SecureStoreProvider) StreamEventsApiListener(com.google.gerrit.server.events.StreamEventsApiListener) CanonicalWebUrlModule(com.google.gerrit.server.config.CanonicalWebUrlModule) DataSourceProvider(com.google.gerrit.server.schema.DataSourceProvider) CanonicalWebUrlProvider(com.google.gerrit.server.config.CanonicalWebUrlProvider) HttpCanonicalWebUrlProvider(com.google.gerrit.httpd.HttpCanonicalWebUrlProvider) SecureStoreProvider(com.google.gerrit.server.securestore.SecureStoreProvider) Provider(com.google.inject.Provider) AbstractModule(com.google.inject.AbstractModule) LogFileCompressor(com.google.gerrit.pgm.util.LogFileCompressor) DiffExecutorModule(com.google.gerrit.server.patch.DiffExecutorModule) SmtpEmailSender(com.google.gerrit.server.mail.send.SmtpEmailSender) AuthConfigModule(com.google.gerrit.server.config.AuthConfigModule) Module(com.google.inject.Module) CanonicalWebUrlModule(com.google.gerrit.server.config.CanonicalWebUrlModule) DummyIndexModule(com.google.gerrit.server.index.DummyIndexModule) GerritGlobalModule(com.google.gerrit.server.config.GerritGlobalModule) LuceneIndexModule(com.google.gerrit.lucene.LuceneIndexModule) DefaultPermissionBackendModule(com.google.gerrit.server.project.DefaultPermissionBackendModule) OAuthModule(com.google.gerrit.httpd.auth.oauth.OAuthModule) MimeUtil2Module(com.google.gerrit.server.mime.MimeUtil2Module) GarbageCollectionModule(com.google.gerrit.server.git.GarbageCollectionModule) WebSshGlueModule(com.google.gerrit.httpd.WebSshGlueModule) SshModule(com.google.gerrit.sshd.SshModule) SshAddressesModule(com.google.gerrit.server.ssh.SshAddressesModule) HttpPluginModule(com.google.gerrit.httpd.plugins.HttpPluginModule) DefaultCommandModule(com.google.gerrit.sshd.commands.DefaultCommandModule) WebModule(com.google.gerrit.httpd.WebModule) PluginRestApiModule(com.google.gerrit.server.plugins.PluginRestApiModule) ReceiveCommitsExecutorModule(com.google.gerrit.server.git.ReceiveCommitsExecutorModule) ElasticIndexModule(com.google.gerrit.elasticsearch.ElasticIndexModule) GitOverHttpModule(com.google.gerrit.httpd.GitOverHttpModule) IndexModule(com.google.gerrit.server.index.IndexModule) StaticModule(com.google.gerrit.httpd.raw.StaticModule) RestCacheAdminModule(com.google.gerrit.server.config.RestCacheAdminModule) IndexCommandsModule(com.google.gerrit.sshd.commands.IndexCommandsModule) JettyModule(com.google.gerrit.pgm.http.jetty.JettyModule) DiffExecutorModule(com.google.gerrit.server.patch.DiffExecutorModule) NoSshModule(com.google.gerrit.server.ssh.NoSshModule) GpgModule(com.google.gerrit.gpg.GpgModule) OpenIdModule(com.google.gerrit.httpd.auth.openid.OpenIdModule) SshHostKeyModule(com.google.gerrit.sshd.SshHostKeyModule) AbstractModule(com.google.inject.AbstractModule) ReceiveCommitsExecutorModule(com.google.gerrit.server.git.ReceiveCommitsExecutorModule)

Example 2 with RestCacheAdminModule

use of com.google.gerrit.server.config.RestCacheAdminModule in project gerrit by GerritCodeReview.

the class WebAppInitializer method createSysInjector.

private Injector createSysInjector() {
    final List<Module> modules = new ArrayList<>();
    modules.add(new DropWizardMetricMaker.RestModule());
    modules.add(new LogFileCompressor.Module());
    modules.add(new EventBroker.Module());
    modules.add(new JdbcAccountPatchReviewStore.Module(config));
    modules.add(cfgInjector.getInstance(GitRepositoryManagerModule.class));
    modules.add(new StreamEventsApiListener.Module());
    modules.add(new ReceiveCommitsExecutorModule());
    modules.add(new DiffExecutorModule());
    modules.add(new MimeUtil2Module());
    modules.add(cfgInjector.getInstance(GerritGlobalModule.class));
    modules.add(new SearchingChangeCacheImpl.Module());
    modules.add(new InternalAccountDirectory.Module());
    modules.add(new DefaultPermissionBackendModule());
    modules.add(new DefaultCacheFactory.Module());
    modules.add(cfgInjector.getInstance(MailReceiver.Module.class));
    modules.add(new SmtpEmailSender.Module());
    modules.add(new SignedTokenEmailTokenVerifier.Module());
    modules.add(new PluginRestApiModule());
    modules.add(new RestCacheAdminModule());
    modules.add(new GpgModule(config));
    modules.add(new StartupChecks.Module());
    // Index module shutdown must happen before work queue shutdown, otherwise
    // work queue can get stuck waiting on index futures that will never return.
    modules.add(createIndexModule());
    modules.add(new WorkQueue.Module());
    modules.add(new CanonicalWebUrlModule() {

        @Override
        protected Class<? extends Provider<String>> provider() {
            return HttpCanonicalWebUrlProvider.class;
        }
    });
    modules.add(SshKeyCacheImpl.module());
    modules.add(new AbstractModule() {

        @Override
        protected void configure() {
            bind(GerritOptions.class).toInstance(new GerritOptions(config, false, false, false));
        }
    });
    modules.add(new GarbageCollectionModule());
    modules.add(new ChangeCleanupRunner.Module());
    modules.addAll(LibModuleLoader.loadModules(cfgInjector));
    return cfgInjector.createChildInjector(modules);
}
Also used : JdbcAccountPatchReviewStore(com.google.gerrit.server.schema.JdbcAccountPatchReviewStore) ArrayList(java.util.ArrayList) InternalAccountDirectory(com.google.gerrit.server.account.InternalAccountDirectory) MimeUtil2Module(com.google.gerrit.server.mime.MimeUtil2Module) WorkQueue(com.google.gerrit.server.git.WorkQueue) SignedTokenEmailTokenVerifier(com.google.gerrit.server.mail.SignedTokenEmailTokenVerifier) GerritGlobalModule(com.google.gerrit.server.config.GerritGlobalModule) StartupChecks(com.google.gerrit.server.StartupChecks) ChangeCleanupRunner(com.google.gerrit.server.change.ChangeCleanupRunner) GarbageCollectionModule(com.google.gerrit.server.git.GarbageCollectionModule) RestCacheAdminModule(com.google.gerrit.server.config.RestCacheAdminModule) DropWizardMetricMaker(com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker) GpgModule(com.google.gerrit.gpg.GpgModule) DefaultPermissionBackendModule(com.google.gerrit.server.project.DefaultPermissionBackendModule) EventBroker(com.google.gerrit.common.EventBroker) SearchingChangeCacheImpl(com.google.gerrit.server.git.SearchingChangeCacheImpl) PluginRestApiModule(com.google.gerrit.server.plugins.PluginRestApiModule) DefaultCacheFactory(com.google.gerrit.server.cache.h2.DefaultCacheFactory) GerritOptions(com.google.gerrit.server.config.GerritOptions) GitRepositoryManagerModule(com.google.gerrit.server.git.GitRepositoryManagerModule) StreamEventsApiListener(com.google.gerrit.server.events.StreamEventsApiListener) CanonicalWebUrlModule(com.google.gerrit.server.config.CanonicalWebUrlModule) DataSourceProvider(com.google.gerrit.server.schema.DataSourceProvider) Provider(com.google.inject.Provider) AbstractModule(com.google.inject.AbstractModule) LogFileCompressor(com.google.gerrit.pgm.util.LogFileCompressor) DiffExecutorModule(com.google.gerrit.server.patch.DiffExecutorModule) SmtpEmailSender(com.google.gerrit.server.mail.send.SmtpEmailSender) GitRepositoryManagerModule(com.google.gerrit.server.git.GitRepositoryManagerModule) AuthConfigModule(com.google.gerrit.server.config.AuthConfigModule) Module(com.google.inject.Module) CanonicalWebUrlModule(com.google.gerrit.server.config.CanonicalWebUrlModule) GerritGlobalModule(com.google.gerrit.server.config.GerritGlobalModule) DataSourceModule(com.google.gerrit.server.schema.DataSourceModule) DatabaseModule(com.google.gerrit.server.schema.DatabaseModule) LifecycleModule(com.google.gerrit.lifecycle.LifecycleModule) LuceneIndexModule(com.google.gerrit.lucene.LuceneIndexModule) DefaultPermissionBackendModule(com.google.gerrit.server.project.DefaultPermissionBackendModule) OAuthModule(com.google.gerrit.httpd.auth.oauth.OAuthModule) SchemaModule(com.google.gerrit.server.schema.SchemaModule) MimeUtil2Module(com.google.gerrit.server.mime.MimeUtil2Module) GarbageCollectionModule(com.google.gerrit.server.git.GarbageCollectionModule) SshModule(com.google.gerrit.sshd.SshModule) GerritServerConfigModule(com.google.gerrit.server.config.GerritServerConfigModule) SshAddressesModule(com.google.gerrit.server.ssh.SshAddressesModule) HttpPluginModule(com.google.gerrit.httpd.plugins.HttpPluginModule) DefaultCommandModule(com.google.gerrit.sshd.commands.DefaultCommandModule) PluginRestApiModule(com.google.gerrit.server.plugins.PluginRestApiModule) ReceiveCommitsExecutorModule(com.google.gerrit.server.git.ReceiveCommitsExecutorModule) ElasticIndexModule(com.google.gerrit.elasticsearch.ElasticIndexModule) IndexModule(com.google.gerrit.server.index.IndexModule) StaticModule(com.google.gerrit.httpd.raw.StaticModule) RestCacheAdminModule(com.google.gerrit.server.config.RestCacheAdminModule) IndexCommandsModule(com.google.gerrit.sshd.commands.IndexCommandsModule) DiffExecutorModule(com.google.gerrit.server.patch.DiffExecutorModule) NoSshModule(com.google.gerrit.server.ssh.NoSshModule) GpgModule(com.google.gerrit.gpg.GpgModule) OpenIdModule(com.google.gerrit.httpd.auth.openid.OpenIdModule) SshHostKeyModule(com.google.gerrit.sshd.SshHostKeyModule) AbstractModule(com.google.inject.AbstractModule) ReceiveCommitsExecutorModule(com.google.gerrit.server.git.ReceiveCommitsExecutorModule)

Aggregations

EventBroker (com.google.gerrit.common.EventBroker)2 ElasticIndexModule (com.google.gerrit.elasticsearch.ElasticIndexModule)2 GpgModule (com.google.gerrit.gpg.GpgModule)2 OAuthModule (com.google.gerrit.httpd.auth.oauth.OAuthModule)2 OpenIdModule (com.google.gerrit.httpd.auth.openid.OpenIdModule)2 HttpPluginModule (com.google.gerrit.httpd.plugins.HttpPluginModule)2 StaticModule (com.google.gerrit.httpd.raw.StaticModule)2 LuceneIndexModule (com.google.gerrit.lucene.LuceneIndexModule)2 DropWizardMetricMaker (com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker)2 LogFileCompressor (com.google.gerrit.pgm.util.LogFileCompressor)2 StartupChecks (com.google.gerrit.server.StartupChecks)2 InternalAccountDirectory (com.google.gerrit.server.account.InternalAccountDirectory)2 DefaultCacheFactory (com.google.gerrit.server.cache.h2.DefaultCacheFactory)2 ChangeCleanupRunner (com.google.gerrit.server.change.ChangeCleanupRunner)2 AuthConfigModule (com.google.gerrit.server.config.AuthConfigModule)2 CanonicalWebUrlModule (com.google.gerrit.server.config.CanonicalWebUrlModule)2 GerritGlobalModule (com.google.gerrit.server.config.GerritGlobalModule)2 GerritOptions (com.google.gerrit.server.config.GerritOptions)2 RestCacheAdminModule (com.google.gerrit.server.config.RestCacheAdminModule)2 StreamEventsApiListener (com.google.gerrit.server.events.StreamEventsApiListener)2