pankaj

Create a component for metrics

...@@ -60,6 +60,10 @@ ...@@ -60,6 +60,10 @@
60 <artifactId>metrics-core</artifactId> 60 <artifactId>metrics-core</artifactId>
61 <version>3.1.0</version> 61 <version>3.1.0</version>
62 </dependency> 62 </dependency>
63 + <dependency>
64 + <groupId>org.apache.felix</groupId>
65 + <artifactId>org.apache.felix.scr.annotations</artifactId>
66 + </dependency>
63 </dependencies> 67 </dependencies>
64 68
65 </project> 69 </project>
......
...@@ -7,6 +7,10 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -7,6 +7,10 @@ import java.util.concurrent.ConcurrentHashMap;
7 import java.util.concurrent.ConcurrentMap; 7 import java.util.concurrent.ConcurrentMap;
8 import java.util.concurrent.TimeUnit; 8 import java.util.concurrent.TimeUnit;
9 9
10 +import org.apache.felix.scr.annotations.Activate;
11 +import org.apache.felix.scr.annotations.Component;
12 +import org.apache.felix.scr.annotations.Deactivate;
13 +
10 import com.codahale.metrics.Counter; 14 import com.codahale.metrics.Counter;
11 import com.codahale.metrics.CsvReporter; 15 import com.codahale.metrics.CsvReporter;
12 import com.codahale.metrics.Gauge; 16 import com.codahale.metrics.Gauge;
...@@ -49,6 +53,7 @@ import com.codahale.metrics.Timer; ...@@ -49,6 +53,7 @@ import com.codahale.metrics.Timer;
49 * </code> 53 * </code>
50 * </pre> 54 * </pre>
51 */ 55 */
56 +@Component(immediate = true)
52 public final class MetricsManager implements MetricsService { 57 public final class MetricsManager implements MetricsService {
53 58
54 /** 59 /**
...@@ -79,6 +84,14 @@ public final class MetricsManager implements MetricsService { ...@@ -79,6 +84,14 @@ public final class MetricsManager implements MetricsService {
79 reporter.start(10, TimeUnit.SECONDS); 84 reporter.start(10, TimeUnit.SECONDS);
80 } 85 }
81 86
87 + @Activate
88 + public void activate() {
89 + }
90 +
91 + @Deactivate
92 + public void deactivate() {
93 + }
94 +
82 /** 95 /**
83 * Registers a component. 96 * Registers a component.
84 * 97 *
......