00ecb72703710fac9fe54598f1599f2a3dc873b0
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / jmx / mbeans / DatastoreInfoMXBeanImpl.java
1 /*
2  * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
9
10 import org.opendaylight.controller.cluster.datastore.utils.ActorUtils;
11 import org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean;
12
13 /**
14  * Implementation of DatastoreInfoMXBean.
15  *
16  * @author Thomas Pantelis
17  */
18 public class DatastoreInfoMXBeanImpl extends AbstractMXBean implements DatastoreInfoMXBean {
19     private final ActorUtils actorUtils;
20
21     public DatastoreInfoMXBeanImpl(final String mxBeanType, final ActorUtils actorUtils) {
22         super("GeneralRuntimeInfo", mxBeanType, null);
23         this.actorUtils = actorUtils;
24     }
25
26     @Override
27     public double getTransactionCreationRateLimit() {
28         return actorUtils.getTxCreationLimit();
29     }
30
31     @Override
32     public long getAskTimeoutExceptionCount() {
33         return actorUtils.getAskTimeoutExceptionCount();
34     }
35
36     @Override
37     public void resetAskTimeoutExceptionCount() {
38         actorUtils.resetAskTimeoutExceptionCount();
39     }
40 }