Search in sources :

Example 1 with DynamicWritableWrapper

use of org.opendaylight.controller.config.manager.impl.dynamicmbean.DynamicWritableWrapper in project controller by opendaylight.

the class ConfigTransactionControllerImpl method putConfigBeanToJMXAndInternalMaps.

private synchronized ObjectName putConfigBeanToJMXAndInternalMaps(final ModuleIdentifier moduleIdentifier, final Module module, final ModuleFactory moduleFactory, @Nullable final ModuleInternalInfo maybeOldConfigBeanInfo, final DependencyResolver dependencyResolver, final boolean isDefaultBean, final BundleContext bundleContext) throws InstanceAlreadyExistsException {
    LOG.debug("Adding module {} to transaction {}", moduleIdentifier, this);
    if (!moduleIdentifier.equals(module.getIdentifier())) {
        throw new IllegalStateException("Incorrect name reported by module. Expected " + moduleIdentifier + ", got " + module.getIdentifier());
    }
    if (!dependencyResolver.getIdentifier().equals(moduleIdentifier)) {
        throw new IllegalStateException("Incorrect name reported by dependency resolver. Expected " + moduleIdentifier + ", got " + dependencyResolver.getIdentifier());
    }
    DynamicMBean writableDynamicWrapper = new DynamicWritableWrapper(module, moduleIdentifier, getTransactionIdentifier().getName(), readOnlyAtomicBoolean, transactionsMBeanServer, configMBeanServer);
    ObjectName writableON = ObjectNameUtil.createTransactionModuleON(getTransactionIdentifier().getName(), moduleIdentifier);
    // put wrapper to jmx
    TransactionModuleJMXRegistration transactionModuleJMXRegistration = getTxModuleJMXRegistrator().registerMBean(writableDynamicWrapper, writableON);
    dependencyResolverManager.put(moduleIdentifier, module, moduleFactory, maybeOldConfigBeanInfo, transactionModuleJMXRegistration, isDefaultBean, bundleContext);
    return writableON;
}
Also used : DynamicMBean(javax.management.DynamicMBean) TransactionModuleJMXRegistration(org.opendaylight.controller.config.manager.impl.jmx.TransactionModuleJMXRegistrator.TransactionModuleJMXRegistration) DynamicWritableWrapper(org.opendaylight.controller.config.manager.impl.dynamicmbean.DynamicWritableWrapper) ObjectName(javax.management.ObjectName)

Aggregations

DynamicMBean (javax.management.DynamicMBean)1 ObjectName (javax.management.ObjectName)1 DynamicWritableWrapper (org.opendaylight.controller.config.manager.impl.dynamicmbean.DynamicWritableWrapper)1 TransactionModuleJMXRegistration (org.opendaylight.controller.config.manager.impl.jmx.TransactionModuleJMXRegistrator.TransactionModuleJMXRegistration)1