Search in sources :

Example 6 with LifecycleModule

use of com.google.gerrit.lifecycle.LifecycleModule in project gerrit by GerritCodeReview.

the class ServerPluginInfoModule method configure.

@Override
protected void configure() {
    bind(PluginUser.class).toInstance(plugin.getPluginUser());
    bind(String.class).annotatedWith(PluginName.class).toInstance(plugin.getName());
    bind(String.class).annotatedWith(PluginCanonicalWebUrl.class).toInstance(plugin.getPluginCanonicalWebUrl());
    install(new LifecycleModule() {

        @Override
        public void configure() {
            PluginMetricMaker metrics = new PluginMetricMaker(serverMetrics, MoreObjects.firstNonNull(plugin.getMetricsPrefix(), String.format("plugins/%s/", plugin.getName())));
            bind(MetricMaker.class).toInstance(metrics);
            listener().toInstance(metrics);
        }
    });
}
Also used : PluginName(com.google.gerrit.extensions.annotations.PluginName) PluginCanonicalWebUrl(com.google.gerrit.extensions.annotations.PluginCanonicalWebUrl) PluginUser(com.google.gerrit.server.PluginUser) LifecycleModule(com.google.gerrit.lifecycle.LifecycleModule)

Aggregations

LifecycleModule (com.google.gerrit.lifecycle.LifecycleModule)6 DropWizardMetricMaker (com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker)4 GerritServerConfigModule (com.google.gerrit.server.config.GerritServerConfigModule)4 SitePath (com.google.gerrit.server.config.SitePath)4 GitRepositoryManagerModule (com.google.gerrit.server.git.GitRepositoryManagerModule)4 SchemaModule (com.google.gerrit.server.schema.SchemaModule)4 AbstractModule (com.google.inject.AbstractModule)4 Module (com.google.inject.Module)4 ArrayList (java.util.ArrayList)4 Injector (com.google.inject.Injector)3 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 AuthConfigModule (com.google.gerrit.server.config.AuthConfigModule)2 CanonicalWebUrlModule (com.google.gerrit.server.config.CanonicalWebUrlModule)2 GerritGlobalModule (com.google.gerrit.server.config.GerritGlobalModule)2 GerritServerConfig (com.google.gerrit.server.config.GerritServerConfig)2