Correct javadoc reference
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / common / actor / AbstractUntypedActorWithMetering.java
index 5497f93c4371a2c044bdaf05266e40656b4ff50e..2124b24faf29ac92859b50834c8cbbe654a84bc3 100644 (file)
@@ -12,13 +12,28 @@ package org.opendaylight.controller.cluster.common.actor;
  */
 public abstract class AbstractUntypedActorWithMetering extends AbstractUntypedActor {
 
+    //this is used in the metric name. Some transient actors do not have defined names
+    private String actorNameOverride;
+
     public AbstractUntypedActorWithMetering() {
-        if (isMetricsCaptureEnabled())
+        if (isMetricsCaptureEnabled()) {
+            getContext().become(new MeteringBehavior(this));
+        }
+    }
+
+    public AbstractUntypedActorWithMetering(String actorNameOverride) {
+        this.actorNameOverride = actorNameOverride;
+        if (isMetricsCaptureEnabled()) {
             getContext().become(new MeteringBehavior(this));
+        }
     }
 
-    private boolean isMetricsCaptureEnabled(){
+    private boolean isMetricsCaptureEnabled() {
         CommonConfig config = new CommonConfig(getContext().system().settings().config());
         return config.isMetricCaptureEnabled();
     }
+
+    public String getActorNameOverride() {
+        return actorNameOverride;
+    }
 }