2 * Copyright (c) 2013 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.config.manager.impl.jmx;
10 import javax.management.InstanceAlreadyExistsException;
11 import javax.management.MBeanServer;
13 import org.opendaylight.controller.config.api.jmx.ConfigRegistryMXBean;
14 import org.opendaylight.controller.config.manager.impl.ConfigRegistryImplMXBean;
17 * This registrator is used only to register Config Registry to JMX.
20 public class ConfigRegistryJMXRegistrator implements AutoCloseable {
21 private final InternalJMXRegistrator internalJMXRegistrator;
23 public ConfigRegistryJMXRegistrator(MBeanServer configMBeanServer) {
24 internalJMXRegistrator = new InternalJMXRegistrator(configMBeanServer);
27 public AutoCloseable registerToJMX(ConfigRegistryImplMXBean configRegistry)
28 throws InstanceAlreadyExistsException {
29 return internalJMXRegistrator.registerMBean(configRegistry,
30 ConfigRegistryMXBean.OBJECT_NAME);
35 internalJMXRegistrator.close();