Search in sources :

Example 1 with AsyncReceiveCommitsModule

use of com.google.gerrit.server.git.receive.AsyncReceiveCommits.AsyncReceiveCommitsModule in project gerrit by GerritCodeReview.

the class SshModule method configure.

@Override
protected void configure() {
    bindScope(RequestScoped.class, SshScope.REQUEST);
    bind(RequestScopePropagator.class).to(SshScope.Propagator.class);
    bind(SshScope.class).in(SINGLETON);
    configureRequestScope();
    install(new AsyncReceiveCommitsModule());
    configureAliases();
    bind(SshLog.class);
    DynamicSet.bind(binder(), GerritConfigListener.class).to(SshLog.class);
    bind(SshInfo.class).to(SshDaemon.class).in(SINGLETON);
    factory(DispatchCommand.Factory.class);
    factory(PeerDaemonUser.Factory.class);
    bind(DispatchCommandProvider.class).annotatedWith(Commands.CMD_ROOT).toInstance(new DispatchCommandProvider(Commands.CMD_ROOT));
    bind(CommandFactoryProvider.class);
    bind(CommandFactory.class).toProvider(CommandFactoryProvider.class);
    bind(ScheduledThreadPoolExecutor.class).annotatedWith(StreamCommandExecutor.class).toProvider(StreamCommandExecutorProvider.class).in(SINGLETON);
    bind(QueueProvider.class).to(CommandExecutorQueueProvider.class);
    bind(GSSAuthenticator.class).to(GerritGSSAuthenticator.class);
    bind(PublickeyAuthenticator.class).to(CachingPublicKeyAuthenticator.class);
    bind(ModuleGenerator.class).to(SshAutoRegisterModuleGenerator.class);
    bind(SshPluginStarterCallback.class);
    bind(StartPluginListener.class).annotatedWith(UniqueAnnotations.create()).to(SshPluginStarterCallback.class);
    bind(ReloadPluginListener.class).annotatedWith(UniqueAnnotations.create()).to(SshPluginStarterCallback.class);
    DynamicItem.itemOf(binder(), SshCreateCommandInterceptor.class);
    DynamicSet.setOf(binder(), SshExecuteCommandInterceptor.class);
    DynamicSet.bind(binder(), AccountActivationListener.class).to(InactiveAccountDisconnector.class);
    listener().toInstance(registerInParentInjectors());
    listener().to(SshLog.class);
    listener().to(SshDaemon.class);
    listener().to(CommandFactoryProvider.class);
}
Also used : RequestScopePropagator(com.google.gerrit.server.util.RequestScopePropagator) GSSAuthenticator(org.apache.sshd.server.auth.gss.GSSAuthenticator) PublickeyAuthenticator(org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator) ScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor) AsyncReceiveCommitsModule(com.google.gerrit.server.git.receive.AsyncReceiveCommits.AsyncReceiveCommitsModule) CommandFactory(org.apache.sshd.server.command.CommandFactory) PeerDaemonUser(com.google.gerrit.server.PeerDaemonUser) QueueProvider(com.google.gerrit.server.git.QueueProvider) ModuleGenerator(com.google.gerrit.server.plugins.ModuleGenerator) AccountActivationListener(com.google.gerrit.extensions.events.AccountActivationListener) GerritConfigListener(com.google.gerrit.server.config.GerritConfigListener)

Example 2 with AsyncReceiveCommitsModule

use of com.google.gerrit.server.git.receive.AsyncReceiveCommits.AsyncReceiveCommitsModule in project gerrit by GerritCodeReview.

the class WebModule method configure.

@Override
protected void configure() {
    bind(RequestScopePropagator.class).to(GuiceRequestScopePropagator.class);
    bind(HttpRequestContext.class);
    installAuthModule();
    if (options.enableMasterFeatures()) {
        install(new UrlModule(authConfig));
    }
    install(new GerritRequestModule());
    install(new GitOverHttpServletModule(options.enableMasterFeatures()));
    if (gitwebCgiConfig.getGitwebCgi() != null) {
        install(new GitwebModule());
    }
    install(new AsyncReceiveCommitsModule());
    bind(SocketAddress.class).annotatedWith(RemotePeer.class).toProvider(HttpRemotePeerProvider.class).in(RequestScoped.class);
    bind(ProxyProperties.class).toProvider(ProxyPropertiesProvider.class);
    listener().toInstance(registerInParentInjectors());
    install(UniversalWebLoginFilter.module());
    // Static injection was unfortunately the best solution in this place. However, it is to be
    // avoided if possible.
    requestStaticInjection(WebSessionManager.Val.class);
}
Also used : GerritRequestModule(com.google.gerrit.server.config.GerritRequestModule) RequestScopePropagator(com.google.gerrit.server.util.RequestScopePropagator) GuiceRequestScopePropagator(com.google.gerrit.server.util.GuiceRequestScopePropagator) GitOverHttpServletModule(com.google.gerrit.httpd.GitOverHttpServlet.GitOverHttpServletModule) AsyncReceiveCommitsModule(com.google.gerrit.server.git.receive.AsyncReceiveCommits.AsyncReceiveCommitsModule) GitwebModule(com.google.gerrit.httpd.gitweb.GitwebModule) SocketAddress(java.net.SocketAddress)

Example 3 with AsyncReceiveCommitsModule

use of com.google.gerrit.server.git.receive.AsyncReceiveCommits.AsyncReceiveCommitsModule in project gerrit by GerritCodeReview.

the class GerritServer method createTestInjector.

private static Injector createTestInjector(Daemon daemon) throws Exception {
    Injector sysInjector = getInjector(daemon, "sysInjector");
    Module module = new FactoryModule() {

        @Override
        protected void configure() {
            bindConstant().annotatedWith(SshEnabled.class).to(daemon.getEnableSshd());
            bind(AccountCreator.class);
            bind(AccountOperations.class).to(AccountOperationsImpl.class);
            bind(GroupOperations.class).to(GroupOperationsImpl.class);
            bind(ProjectOperations.class).to(ProjectOperationsImpl.class);
            bind(RequestScopeOperations.class).to(RequestScopeOperationsImpl.class);
            bind(ChangeOperations.class).to(ChangeOperationsImpl.class);
            factory(PerPatchsetOperationsImpl.Factory.class);
            factory(PerCommentOperationsImpl.Factory.class);
            factory(PerDraftCommentOperationsImpl.Factory.class);
            factory(PerRobotCommentOperationsImpl.Factory.class);
            factory(PushOneCommit.Factory.class);
            install(InProcessProtocol.module());
            install(new NoSshModule());
            install(new AsyncReceiveCommitsModule());
            factory(ProjectResetter.Builder.Factory.class);
        }

        @Provides
        @Singleton
        @Nullable
        @TestSshServerAddress
        InetSocketAddress getSshAddress(@GerritServerConfig Config cfg) {
            String addr = cfg.getString("sshd", null, "listenAddress");
            // We do not use InitSshd.isOff to avoid coupling GerritServer to the SSH code.
            return !"off".equalsIgnoreCase(addr) ? SocketUtil.resolve(cfg.getString("sshd", null, "listenAddress"), 0) : null;
        }
    };
    return sysInjector.createChildInjector(module);
}
Also used : AccountOperations(com.google.gerrit.acceptance.testsuite.account.AccountOperations) GerritServerConfig(com.google.gerrit.server.config.GerritServerConfig) NoSshModule(com.google.gerrit.server.ssh.NoSshModule) FactoryModule(com.google.gerrit.extensions.config.FactoryModule) Config(org.eclipse.jgit.lib.Config) GlobalPluginConfig(com.google.gerrit.acceptance.config.GlobalPluginConfig) GerritServerConfig(com.google.gerrit.server.config.GerritServerConfig) GerritConfig(com.google.gerrit.acceptance.config.GerritConfig) AsyncReceiveCommitsModule(com.google.gerrit.server.git.receive.AsyncReceiveCommits.AsyncReceiveCommitsModule) ChangeOperations(com.google.gerrit.acceptance.testsuite.change.ChangeOperations) PerPatchsetOperationsImpl(com.google.gerrit.acceptance.testsuite.change.PerPatchsetOperationsImpl) PerDraftCommentOperationsImpl(com.google.gerrit.acceptance.testsuite.change.PerDraftCommentOperationsImpl) PerCommentOperationsImpl(com.google.gerrit.acceptance.testsuite.change.PerCommentOperationsImpl) GroupOperations(com.google.gerrit.acceptance.testsuite.group.GroupOperations) Injector(com.google.inject.Injector) PerRobotCommentOperationsImpl(com.google.gerrit.acceptance.testsuite.change.PerRobotCommentOperationsImpl) Module(com.google.inject.Module) FakeIndexModule(com.google.gerrit.index.testing.FakeIndexModule) ConfigExperimentFeaturesModule(com.google.gerrit.server.experiments.ConfigExperimentFeatures.ConfigExperimentFeaturesModule) LuceneIndexModule(com.google.gerrit.lucene.LuceneIndexModule) ReindexProjectsAtStartupModule(com.google.gerrit.acceptance.ReindexProjectsAtStartup.ReindexProjectsAtStartupModule) FactoryModule(com.google.gerrit.extensions.config.FactoryModule) FakeEmailSenderModule(com.google.gerrit.testing.FakeEmailSender.FakeEmailSenderModule) ReindexGroupsAtStartupModule(com.google.gerrit.acceptance.ReindexGroupsAtStartup.ReindexGroupsAtStartupModule) FakeGroupAuditServiceModule(com.google.gerrit.acceptance.FakeGroupAuditService.FakeGroupAuditServiceModule) NoSshModule(com.google.gerrit.server.ssh.NoSshModule) AsyncReceiveCommitsModule(com.google.gerrit.server.git.receive.AsyncReceiveCommits.AsyncReceiveCommitsModule) AbstractModule(com.google.inject.AbstractModule) ProjectOperations(com.google.gerrit.acceptance.testsuite.project.ProjectOperations) RequestScopeOperations(com.google.gerrit.acceptance.testsuite.request.RequestScopeOperations)

Aggregations

AsyncReceiveCommitsModule (com.google.gerrit.server.git.receive.AsyncReceiveCommits.AsyncReceiveCommitsModule)3 RequestScopePropagator (com.google.gerrit.server.util.RequestScopePropagator)2 FakeGroupAuditServiceModule (com.google.gerrit.acceptance.FakeGroupAuditService.FakeGroupAuditServiceModule)1 ReindexGroupsAtStartupModule (com.google.gerrit.acceptance.ReindexGroupsAtStartup.ReindexGroupsAtStartupModule)1 ReindexProjectsAtStartupModule (com.google.gerrit.acceptance.ReindexProjectsAtStartup.ReindexProjectsAtStartupModule)1 GerritConfig (com.google.gerrit.acceptance.config.GerritConfig)1 GlobalPluginConfig (com.google.gerrit.acceptance.config.GlobalPluginConfig)1 AccountOperations (com.google.gerrit.acceptance.testsuite.account.AccountOperations)1 ChangeOperations (com.google.gerrit.acceptance.testsuite.change.ChangeOperations)1 PerCommentOperationsImpl (com.google.gerrit.acceptance.testsuite.change.PerCommentOperationsImpl)1 PerDraftCommentOperationsImpl (com.google.gerrit.acceptance.testsuite.change.PerDraftCommentOperationsImpl)1 PerPatchsetOperationsImpl (com.google.gerrit.acceptance.testsuite.change.PerPatchsetOperationsImpl)1 PerRobotCommentOperationsImpl (com.google.gerrit.acceptance.testsuite.change.PerRobotCommentOperationsImpl)1 GroupOperations (com.google.gerrit.acceptance.testsuite.group.GroupOperations)1 ProjectOperations (com.google.gerrit.acceptance.testsuite.project.ProjectOperations)1 RequestScopeOperations (com.google.gerrit.acceptance.testsuite.request.RequestScopeOperations)1 FactoryModule (com.google.gerrit.extensions.config.FactoryModule)1 AccountActivationListener (com.google.gerrit.extensions.events.AccountActivationListener)1 GitOverHttpServletModule (com.google.gerrit.httpd.GitOverHttpServlet.GitOverHttpServletModule)1 GitwebModule (com.google.gerrit.httpd.gitweb.GitwebModule)1