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);
}
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);
}
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);
}
Aggregations