Initial code drop of yang model driven configuration system
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / jmx / BaseJMXRegistrator.java
1 /*
2  * Copyright (c) 2013 Cisco 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.config.manager.impl.jmx;
9
10 import java.util.Set;
11
12 import javax.management.MBeanServer;
13 import javax.management.ObjectName;
14 import javax.management.QueryExp;
15
16 import org.opendaylight.controller.config.api.ModuleIdentifier;
17
18 public class BaseJMXRegistrator implements AutoCloseable {
19
20     private final InternalJMXRegistrator internalJMXRegistrator;
21
22     public BaseJMXRegistrator(MBeanServer configMBeanServer) {
23         internalJMXRegistrator = new InternalJMXRegistrator(configMBeanServer);
24     }
25
26     public BaseJMXRegistrator(InternalJMXRegistrator internalJMXRegistrator) {
27         this.internalJMXRegistrator = internalJMXRegistrator;
28     }
29
30     public TransactionJMXRegistrator createTransactionJMXRegistrator(
31             String transactionName) {
32         return new TransactionJMXRegistrator(
33                 internalJMXRegistrator.createChild(), transactionName);
34     }
35
36     public ModuleJMXRegistrator createModuleJMXRegistrator() {
37         return new ModuleJMXRegistrator(internalJMXRegistrator.createChild());
38     }
39
40     public RootRuntimeBeanRegistratorImpl createRuntimeBeanRegistrator(
41             ModuleIdentifier moduleIdentifier) {
42         return new RootRuntimeBeanRegistratorImpl(internalJMXRegistrator,
43                 moduleIdentifier);
44     }
45
46     public Set<ObjectName> queryNames(ObjectName name, QueryExp query) {
47         return internalJMXRegistrator.queryNames(name, query);
48     }
49
50     public Set<ObjectName> getRegisteredObjectNames() {
51         return internalJMXRegistrator.getRegisteredObjectNames();
52     }
53
54     @Override
55     public void close() {
56         internalJMXRegistrator.close();
57     }
58 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.