Create a component for metrics
diff --git a/utils/misc/pom.xml b/utils/misc/pom.xml
index ae47a38..bd3cc08 100644
--- a/utils/misc/pom.xml
+++ b/utils/misc/pom.xml
@@ -60,6 +60,10 @@
<artifactId>metrics-core</artifactId>
<version>3.1.0</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr.annotations</artifactId>
+ </dependency>
</dependencies>
</project>
diff --git a/utils/misc/src/main/java/org/onlab/metrics/MetricsManager.java b/utils/misc/src/main/java/org/onlab/metrics/MetricsManager.java
index a54093f..e07d3f9 100644
--- a/utils/misc/src/main/java/org/onlab/metrics/MetricsManager.java
+++ b/utils/misc/src/main/java/org/onlab/metrics/MetricsManager.java
@@ -7,6 +7,10 @@
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+
import com.codahale.metrics.Counter;
import com.codahale.metrics.CsvReporter;
import com.codahale.metrics.Gauge;
@@ -49,6 +53,7 @@
* </code>
* </pre>
*/
+@Component(immediate = true)
public final class MetricsManager implements MetricsService {
/**
@@ -79,6 +84,14 @@
reporter.start(10, TimeUnit.SECONDS);
}
+ @Activate
+ public void activate() {
+ }
+
+ @Deactivate
+ public void deactivate() {
+ }
+
/**
* Registers a component.
*