2 * Copyright (c) 2014 Brocade Communications 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
9 package org.opendaylight.controller.md.sal.common.util.jmx;
11 import java.util.List;
13 import org.opendaylight.yangtools.util.concurrent.ListenerNotificationQueueStats;
14 import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager;
16 import com.google.common.base.Preconditions;
19 * Implementation of the QueuedNotificationManagerMXBean interface.
22 * This class is not intended for use outside of MD-SAL and its part of private
23 * implementation (still exported as public to be reused across MD-SAL implementation
24 * components) and may be removed in subsequent
27 * @author Thomas Pantelis
29 public class QueuedNotificationManagerMXBeanImpl extends AbstractMXBean
30 implements QueuedNotificationManagerMXBean {
32 private final QueuedNotificationManager<?,?> manager;
34 public QueuedNotificationManagerMXBeanImpl( QueuedNotificationManager<?,?> manager,
35 String mBeanName, String mBeanType, String mBeanCategory ) {
36 super(mBeanName, mBeanType, mBeanCategory);
37 this.manager = Preconditions.checkNotNull( manager );
41 public List<ListenerNotificationQueueStats> getCurrentListenerQueueStats() {
42 return manager.getListenerNotificationQueueStats();
46 public int getMaxListenerQueueSize() {
47 return manager.getMaxQueueCapacity();
50 public QueuedNotificationManagerStats toQueuedNotificationManagerStats() {
51 return new QueuedNotificationManagerStats( getMaxListenerQueueSize(),
52 getCurrentListenerQueueStats() );