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.datastore;
10 import org.eclipse.jdt.annotation.NonNull;
13 * Factory for creating ShardStats mbeans.
15 * @author Basheeruddin syedbahm@cisco.com
17 final class ShardMBeanFactory {
19 private ShardMBeanFactory() {
22 static ShardStats getShardStatsMBean(final String shardName, final String mxBeanType,
23 final @NonNull Shard shard) {
24 String finalMXBeanType = mxBeanType != null ? mxBeanType : "DistDataStore";
25 ShardStats shardStatsMBeanImpl = new ShardStats(shardName, finalMXBeanType, shard);
26 shardStatsMBeanImpl.registerMBean();
27 return shardStatsMBeanImpl;