use of org.opendaylight.controller.config.manager.impl.jmx.TransactionModuleJMXRegistrator in project controller by opendaylight.
the class ConfigTransactionControllerImplTest method setUp.
@Before
public void setUp() throws Exception {
baseJMXRegistrator = new BaseJMXRegistrator(ManagementFactory.getPlatformMBeanServer());
transactionsMBeanServer = MBeanServerFactory.createMBeanServer();
Map<String, Map.Entry<ModuleFactory, BundleContext>> currentlyRegisteredFactories = new HashMap<>();
ConfigTransactionLookupRegistry txLookupRegistry = new ConfigTransactionLookupRegistry(new TransactionIdentifier(TRANSACTION_NAME123), () -> baseJMXRegistrator.createTransactionJMXRegistrator(TRANSACTION_NAME123), currentlyRegisteredFactories);
SearchableServiceReferenceWritableRegistry writableRegistry = ServiceReferenceRegistryImpl.createSRWritableRegistry(ServiceReferenceRegistryImpl.createInitialSRLookupRegistry(), txLookupRegistry, currentlyRegisteredFactories);
testedTxController = new ConfigTransactionControllerImpl(txLookupRegistry, 1, null, 1, currentlyRegisteredFactories, transactionsMBeanServer, ManagementFactory.getPlatformMBeanServer(), false, writableRegistry);
TransactionModuleJMXRegistrator transactionModuleJMXRegistrator123 = testedTxController.getTxModuleJMXRegistrator();
transactionModuleJMXRegistrator123.registerMBean(new TestingRuntimeBean(), NAME1);
transactionModuleJMXRegistrator123.registerMBean(new TestingRuntimeBean(), NAME2);
transactionModuleJMXRegistrator123.registerMBean(new TestingRuntimeBean(), NAME3);
TransactionJMXRegistrator jmxRegistrator4 = baseJMXRegistrator.createTransactionJMXRegistrator(TRANSACTION_NAME4);
jmxRegistrator4.createTransactionModuleJMXRegistrator().registerMBean(new TestingRuntimeBean(), NAME4);
}
Aggregations