Search in sources :

Example 1 with GerritRequestModule

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

the class InProcessProtocol method module.

static Module module() {
    return new AbstractModule() {

        @Override
        public void configure() {
            install(new GerritRequestModule());
            bind(RequestScopePropagator.class).to(Propagator.class);
            bindScope(RequestScoped.class, InProcessProtocol.REQUEST);
        }

        @Provides
        @RemotePeer
        SocketAddress getSocketAddress() {
            // something.
            throw new OutOfScopeException("No remote peer in acceptance tests");
        }
    };
}
Also used : GerritRequestModule(com.google.gerrit.server.config.GerritRequestModule) RequestScopePropagator(com.google.gerrit.server.util.RequestScopePropagator) ThreadLocalRequestScopePropagator(com.google.gerrit.server.util.ThreadLocalRequestScopePropagator) OutOfScopeException(com.google.inject.OutOfScopeException) AbstractModule(com.google.inject.AbstractModule)

Example 2 with GerritRequestModule

use of com.google.gerrit.server.config.GerritRequestModule 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(options, authConfig));
        install(new UiRpcModule());
    }
    install(new GerritRequestModule());
    install(new GitOverHttpServlet.Module(options.enableMasterFeatures()));
    if (gitwebCgiConfig.getGitwebCgi() != null) {
        install(new GitwebModule());
    }
    install(new AsyncReceiveCommits.Module());
    bind(SocketAddress.class).annotatedWith(RemotePeer.class).toProvider(HttpRemotePeerProvider.class).in(RequestScoped.class);
    bind(ProxyProperties.class).toProvider(ProxyPropertiesProvider.class);
    listener().toInstance(registerInParentInjectors());
    install(UniversalWebLoginFilter.module());
}
Also used : GerritRequestModule(com.google.gerrit.server.config.GerritRequestModule) RequestScopePropagator(com.google.gerrit.server.util.RequestScopePropagator) GuiceRequestScopePropagator(com.google.gerrit.server.util.GuiceRequestScopePropagator) AsyncReceiveCommits(com.google.gerrit.server.git.AsyncReceiveCommits) UiRpcModule(com.google.gerrit.httpd.rpc.UiRpcModule) GitwebModule(com.google.gerrit.httpd.gitweb.GitwebModule) SocketAddress(java.net.SocketAddress)

Example 3 with GerritRequestModule

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

the class SshModule method configureRequestScope.

private void configureRequestScope() {
    bind(SshScope.Context.class).toProvider(SshScope.ContextProvider.class);
    bind(SshSession.class).toProvider(SshScope.SshSessionProvider.class).in(SshScope.REQUEST);
    bind(SocketAddress.class).annotatedWith(RemotePeer.class).toProvider(SshRemotePeerProvider.class).in(SshScope.REQUEST);
    bind(WorkQueue.Executor.class).annotatedWith(CommandExecutor.class).toProvider(CommandExecutorProvider.class).in(SshScope.REQUEST);
    install(new GerritRequestModule());
}
Also used : GerritRequestModule(com.google.gerrit.server.config.GerritRequestModule) SocketAddress(java.net.SocketAddress)

Aggregations

GerritRequestModule (com.google.gerrit.server.config.GerritRequestModule)3 RequestScopePropagator (com.google.gerrit.server.util.RequestScopePropagator)2 SocketAddress (java.net.SocketAddress)2 GitwebModule (com.google.gerrit.httpd.gitweb.GitwebModule)1 UiRpcModule (com.google.gerrit.httpd.rpc.UiRpcModule)1 AsyncReceiveCommits (com.google.gerrit.server.git.AsyncReceiveCommits)1 GuiceRequestScopePropagator (com.google.gerrit.server.util.GuiceRequestScopePropagator)1 ThreadLocalRequestScopePropagator (com.google.gerrit.server.util.ThreadLocalRequestScopePropagator)1 AbstractModule (com.google.inject.AbstractModule)1 OutOfScopeException (com.google.inject.OutOfScopeException)1