package org.axonframework.boot.autoconfig;

import com.codahale.metrics.MetricRegistry;
import org.axonframework.metrics.GlobalMetricRegistry;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
//@AutoConfigureAfter(RoutingStrategyAutoConfiguration.class)
//@AutoConfigureBefore(AxonAutoConfiguration.class)
public class MetricsAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    @ConditionalOnBean(MetricRegistry.class)
    public GlobalMetricRegistry globalMetricRegistry(MetricRegistry metricRegistry) {
        return new GlobalMetricRegistry(metricRegistry);
    }

}

@@ -140,141 +140,8 @@
 ry;%0A
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;%0Aimport org.springframework.boot.autoconfigure.AutoConfigureBefore;%0A
 impo
@@ -411,116 +411,138 @@
 n;%0A%0A
-@Configuration%0A//@AutoConfigureAfter(RoutingStrategyAutoConfiguration.class)%0A//@AutoConfigureBefore(AxonAuto
+/**%0A * Auto configuration to set up Metrics for the infrastructure components.%0A *%0A * @author Steven van Beelen%0A * @since 3.2%0A */%0A@
 Conf
@@ -550,23 +550,16 @@
 guration
-.class)
 %0Apublic 
@@ -826,11 +826,10 @@
 ;%0A    %7D%0A
-%0A
 %7D%0A

Add javadoc