use of org.opendaylight.controller.config.manager.impl.jmx.ServiceReferenceRegistrator.ServiceReferenceTransactionRegistratorFactoryImpl in project controller by opendaylight.
the class ServiceReferenceRegistryImpl method createSRWritableRegistry.
public static SearchableServiceReferenceWritableRegistry createSRWritableRegistry(final ServiceReferenceReadableRegistry oldReadableRegistry, final ConfigTransactionLookupRegistry txLookupRegistry, final Map<String, Map.Entry<ModuleFactory, BundleContext>> currentlyRegisteredFactories) {
if (txLookupRegistry == null) {
throw new IllegalArgumentException("txLookupRegistry is null");
}
ServiceReferenceRegistryImpl old = (ServiceReferenceRegistryImpl) oldReadableRegistry;
Map<String, ModuleFactory> factories = extractFactoriesMap(currentlyRegisteredFactories);
ServiceReferenceTransactionRegistratorFactory serviceReferenceRegistratorFactory = new ServiceReferenceTransactionRegistratorFactoryImpl(txLookupRegistry.getTxModuleJMXRegistrator(), txLookupRegistry.getTxModuleJMXRegistrator().getTransactionName());
ServiceReferenceRegistryImpl newRegistry = new ServiceReferenceRegistryImpl(factories, txLookupRegistry, serviceReferenceRegistratorFactory, true);
copy(old, newRegistry, txLookupRegistry.getTransactionIdentifier().getName());
return newRegistry;
}
use of org.opendaylight.controller.config.manager.impl.jmx.ServiceReferenceRegistrator.ServiceReferenceTransactionRegistratorFactoryImpl in project controller by opendaylight.
the class ServiceReferenceRegistryImpl method createSRReadableRegistry.
/**
* Copy back state to config registry after commit.
*
* @param oldWritableRegistry
* old registry
* @param lookupRegistry
* lookup registry
* @param baseJMXRegistrator
* JMX registrator
* @return service reference
*/
public static CloseableServiceReferenceReadableRegistry createSRReadableRegistry(final ServiceReferenceWritableRegistry oldWritableRegistry, final LookupRegistry lookupRegistry, final BaseJMXRegistrator baseJMXRegistrator) {
ServiceReferenceRegistryImpl old = (ServiceReferenceRegistryImpl) oldWritableRegistry;
// even if factories do change, nothing in the mapping can change between
// transactions
ServiceReferenceTransactionRegistratorFactory serviceReferenceRegistratorFactory = new ServiceReferenceTransactionRegistratorFactoryImpl(baseJMXRegistrator);
ServiceReferenceRegistryImpl newRegistry = new ServiceReferenceRegistryImpl(old.factories, lookupRegistry, serviceReferenceRegistratorFactory, false);
copy(old, newRegistry, null);
return newRegistry;
}
Aggregations