pankaj

cleanup the constructors

1 package org.onlab.metrics; 1 package org.onlab.metrics;
2 2
3 import java.util.Map; 3 import java.util.Map;
4 -import java.util.concurrent.ConcurrentHashMap;
5 import java.util.concurrent.ConcurrentMap; 4 import java.util.concurrent.ConcurrentMap;
6 5
7 import com.codahale.metrics.Counter; 6 import com.codahale.metrics.Counter;
...@@ -50,19 +49,18 @@ public final class MetricsManager implements MetricsService { ...@@ -50,19 +49,18 @@ public final class MetricsManager implements MetricsService {
50 /** 49 /**
51 * Registry to hold the Components defined in the system. 50 * Registry to hold the Components defined in the system.
52 */ 51 */
53 - private ConcurrentMap<String, MetricsComponent> componentsRegistry = 52 + private ConcurrentMap<String, MetricsComponent> componentsRegistry;
54 - new ConcurrentHashMap<>();
55 53
56 /** 54 /**
57 * Registry for the Metrics objects created in the system. 55 * Registry for the Metrics objects created in the system.
58 */ 56 */
59 private final MetricRegistry metricsRegistry = new MetricRegistry(); 57 private final MetricRegistry metricsRegistry = new MetricRegistry();
60 58
61 - /** 59 + public MetricsManager(
62 - * Hide constructor. The only way to get the registry is through the 60 + ConcurrentMap<String, MetricsComponent> componentsRegistry) {
63 - * singleton getter. 61 + this.componentsRegistry = componentsRegistry;
64 - */ 62 +
65 - private MetricsManager() {} 63 + }
66 64
67 /** 65 /**
68 * Registers a component. 66 * Registers a component.
......