Search in sources :

Example 1 with TransactionModuleJMXRegistration

use of org.opendaylight.controller.config.manager.impl.jmx.TransactionModuleJMXRegistrator.TransactionModuleJMXRegistration 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)

Example 2 with TransactionModuleJMXRegistration

use of org.opendaylight.controller.config.manager.impl.jmx.TransactionModuleJMXRegistrator.TransactionModuleJMXRegistration in project controller by opendaylight.

the class DependencyResolverManagerTest method mockGetInstance.

private static void mockGetInstance(final DependencyResolverManager tested, final ModuleIdentifier moduleIdentifier) {
    ModuleFactory moduleFactory = mock(ModuleFactory.class);
    ModuleInternalInfo maybeOldInternalInfo = null;
    TransactionModuleJMXRegistration transactionModuleJMXRegistration = null;
    boolean isDefaultBean = false;
    tested.put(moduleIdentifier, mockedModule(), moduleFactory, maybeOldInternalInfo, transactionModuleJMXRegistration, isDefaultBean, mock(BundleContext.class));
}
Also used : ModuleFactory(org.opendaylight.controller.config.spi.ModuleFactory) TransactionModuleJMXRegistration(org.opendaylight.controller.config.manager.impl.jmx.TransactionModuleJMXRegistrator.TransactionModuleJMXRegistration) ModuleInternalInfo(org.opendaylight.controller.config.manager.impl.ModuleInternalInfo) BundleContext(org.osgi.framework.BundleContext)

Aggregations

TransactionModuleJMXRegistration (org.opendaylight.controller.config.manager.impl.jmx.TransactionModuleJMXRegistrator.TransactionModuleJMXRegistration)2 DynamicMBean (javax.management.DynamicMBean)1 ObjectName (javax.management.ObjectName)1 ModuleInternalInfo (org.opendaylight.controller.config.manager.impl.ModuleInternalInfo)1 DynamicWritableWrapper (org.opendaylight.controller.config.manager.impl.dynamicmbean.DynamicWritableWrapper)1 ModuleFactory (org.opendaylight.controller.config.spi.ModuleFactory)1 BundleContext (org.osgi.framework.BundleContext)1