2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.common.actor;
11 * Actor with its behaviour metered. Metering is enabled by configuration.
13 public abstract class AbstractUntypedActorWithMetering extends AbstractUntypedActor {
15 public AbstractUntypedActorWithMetering() {
16 if (isMetricsCaptureEnabled())
17 getContext().become(new MeteringBehavior(this));
20 private boolean isMetricsCaptureEnabled(){
21 CommonConfig config = new CommonConfig(getContext().system().settings().config());
22 return config.isMetricCaptureEnabled();