james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouaz...@apache.org
Subject [james-project] 02/09: MAILBOX-383 DropWizardInitializer only needs to be startable
Date Tue, 11 Jun 2019 13:22:32 GMT
This is an automated email from the ASF dual-hosted git repository.

rouazana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit aed1344cb86f8fac49fd1146fa588b3579b8bc69
Author: Benoit Tellier <btellier@linagora.com>
AuthorDate: Wed Jun 5 15:19:52 2019 +0700

    MAILBOX-383 DropWizardInitializer only needs to be startable
    
    No configuration operation actually takes place so `Configurable` implementation is inapropriate...
---
 .../james/modules/server/DropWizardMetricsModule.java    | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/DropWizardMetricsModule.java
b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/DropWizardMetricsModule.java
index 473f400..662f9c1 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/DropWizardMetricsModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/DropWizardMetricsModule.java
@@ -21,9 +21,6 @@ package org.apache.james.modules.server;
 
 import java.util.List;
 
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.HierarchicalConfiguration;
-import org.apache.james.lifecycle.api.Configurable;
 import org.apache.james.lifecycle.api.Startable;
 import org.apache.james.metrics.api.GaugeRegistry;
 import org.apache.james.metrics.api.MetricFactory;
@@ -57,8 +54,6 @@ public class DropWizardMetricsModule extends AbstractModule {
 
     @Singleton
     public static class DropWizardConfigurationPerformer implements ConfigurationPerformer
{
-        public static final HierarchicalConfiguration NO_CONFIGURATION = null;
-
         private final DropWizardInitializer dropWizardInitializer;
 
         @Inject
@@ -68,11 +63,7 @@ public class DropWizardMetricsModule extends AbstractModule {
 
         @Override
         public void initModule() {
-            try {
-                dropWizardInitializer.configure(NO_CONFIGURATION);
-            } catch (ConfigurationException e) {
-                throw new RuntimeException(e);
-            }
+            dropWizardInitializer.start();
         }
 
         @Override
@@ -81,7 +72,7 @@ public class DropWizardMetricsModule extends AbstractModule {
         }
     }
 
-    public static class DropWizardInitializer implements Configurable {
+    public static class DropWizardInitializer implements Startable {
         private final DropWizardMetricFactory dropWizardMetricFactory;
         private final DropWizardJVMMetrics dropWizardJVMMetrics;
 
@@ -91,8 +82,7 @@ public class DropWizardMetricsModule extends AbstractModule {
             this.dropWizardJVMMetrics = dropWizardJVMMetrics;
         }
 
-        @Override
-        public void configure(HierarchicalConfiguration config) throws ConfigurationException
{
+        public void start() {
             dropWizardMetricFactory.start();
             dropWizardJVMMetrics.start();
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message