Search in sources :

Example 1 with RoleManagerImpl

use of org.opendaylight.openflowplugin.impl.role.RoleManagerImpl in project openflowplugin by opendaylight.

the class OpenFlowPluginProviderImpl method initialize.

@Override
public void initialize() {
    registerMXBean(MESSAGE_INTELLIGENCE_AGENCY, MESSAGE_INTELLIGENCE_AGENCY_MX_BEAN_NAME);
    // TODO: copied from OpenFlowPluginProvider (Helium) misusesing the old way of distributing extension converters
    // TODO: rewrite later!
    OFSessionUtil.getSessionManager().setExtensionConverterProvider(extensionConverterManager);
    // Creates a thread pool that creates new threads as needed, but will reuse previously
    // constructed threads when they are available.
    // Threads that have not been used for x seconds are terminated and removed from the cache.
    executorService = MoreExecutors.listeningDecorator(new ThreadPoolLoggingExecutor(config.getThreadPoolMinThreads(), config.getThreadPoolMaxThreads().getValue(), config.getThreadPoolTimeout(), TimeUnit.SECONDS, new SynchronousQueue<>(), POOL_NAME));
    deviceManager = new DeviceManagerImpl(config, dataBroker, getMessageIntelligenceAgency(), notificationPublishService, hashedWheelTimer, convertorManager, deviceInitializerProvider);
    TranslatorLibraryUtil.injectBasicTranslatorLibrary(deviceManager, convertorManager);
    ((ExtensionConverterProviderKeeper) deviceManager).setExtensionConverterProvider(extensionConverterManager);
    rpcManager = new RpcManagerImpl(config, rpcProviderRegistry, extensionConverterManager, convertorManager, notificationPublishService);
    statisticsManager = new StatisticsManagerImpl(config, rpcProviderRegistry, convertorManager, executorService);
    roleManager = new RoleManagerImpl(hashedWheelTimer, config);
    contextChainHolder = new ContextChainHolderImpl(executorService, singletonServicesProvider, entityOwnershipService, mastershipChangeServiceManager);
    contextChainHolder.addManager(deviceManager);
    contextChainHolder.addManager(statisticsManager);
    contextChainHolder.addManager(rpcManager);
    contextChainHolder.addManager(roleManager);
    connectionManager = new ConnectionManagerImpl(config, executorService);
    connectionManager.setDeviceConnectedHandler(contextChainHolder);
    connectionManager.setDeviceDisconnectedHandler(contextChainHolder);
    deviceManager.setContextChainHolder(contextChainHolder);
    deviceManager.initialize();
}
Also used : DeviceManagerImpl(org.opendaylight.openflowplugin.impl.device.DeviceManagerImpl) RpcManagerImpl(org.opendaylight.openflowplugin.impl.rpc.RpcManagerImpl) ContextChainHolderImpl(org.opendaylight.openflowplugin.impl.lifecycle.ContextChainHolderImpl) ConnectionManagerImpl(org.opendaylight.openflowplugin.impl.connection.ConnectionManagerImpl) ThreadPoolLoggingExecutor(org.opendaylight.openflowplugin.impl.util.ThreadPoolLoggingExecutor) StatisticsManagerImpl(org.opendaylight.openflowplugin.impl.statistics.StatisticsManagerImpl) RoleManagerImpl(org.opendaylight.openflowplugin.impl.role.RoleManagerImpl) ExtensionConverterProviderKeeper(org.opendaylight.openflowplugin.extension.api.ExtensionConverterProviderKeeper)

Aggregations

ExtensionConverterProviderKeeper (org.opendaylight.openflowplugin.extension.api.ExtensionConverterProviderKeeper)1 ConnectionManagerImpl (org.opendaylight.openflowplugin.impl.connection.ConnectionManagerImpl)1 DeviceManagerImpl (org.opendaylight.openflowplugin.impl.device.DeviceManagerImpl)1 ContextChainHolderImpl (org.opendaylight.openflowplugin.impl.lifecycle.ContextChainHolderImpl)1 RoleManagerImpl (org.opendaylight.openflowplugin.impl.role.RoleManagerImpl)1 RpcManagerImpl (org.opendaylight.openflowplugin.impl.rpc.RpcManagerImpl)1 StatisticsManagerImpl (org.opendaylight.openflowplugin.impl.statistics.StatisticsManagerImpl)1 ThreadPoolLoggingExecutor (org.opendaylight.openflowplugin.impl.util.ThreadPoolLoggingExecutor)1