*/
package org.opendaylight.controller.cluster.common.actor;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
/**
* Actor with its behaviour metered. Metering is enabled by configuration.
*/
public abstract class AbstractUntypedPersistentActorWithMetering extends AbstractUntypedPersistentActor {
-
+ @SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR", justification = "Akka class design")
public AbstractUntypedPersistentActorWithMetering() {
- if (isMetricsCaptureEnabled())
+ if (isMetricsCaptureEnabled()) {
getContext().become(new MeteringBehavior(this));
+ }
}
- private boolean isMetricsCaptureEnabled(){
- CommonConfig config = new CommonConfig(getContext().system().settings().config());
- return config.isMetricCaptureEnabled();
+ private boolean isMetricsCaptureEnabled() {
+ return new CommonConfig(getContext().system().settings().config()).isMetricCaptureEnabled();
}
}