use of org.opendaylight.openflowplugin.extension.api.ExtensionConverterProviderKeeper 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();
}
use of org.opendaylight.openflowplugin.extension.api.ExtensionConverterProviderKeeper in project openflowplugin by opendaylight.
the class DeviceManagerImpl method createContext.
@Override
public DeviceContext createContext(@Nonnull final ConnectionContext connectionContext) {
LOG.info("ConnectionEvent: Device connected to controller, Device:{}, NodeId:{}", connectionContext.getConnectionAdapter().getRemoteAddress(), connectionContext.getDeviceInfo().getNodeId());
connectionContext.getConnectionAdapter().setPacketInFiltering(true);
final OutboundQueueProvider outboundQueueProvider = new OutboundQueueProviderImpl(connectionContext.getDeviceInfo().getVersion());
connectionContext.setOutboundQueueProvider(outboundQueueProvider);
final OutboundQueueHandlerRegistration<OutboundQueueProvider> outboundQueueHandlerRegistration = connectionContext.getConnectionAdapter().registerOutboundQueueHandler(outboundQueueProvider, config.getBarrierCountLimit().getValue(), TimeUnit.MILLISECONDS.toNanos(config.getBarrierIntervalTimeoutLimit().getValue()));
connectionContext.setOutboundQueueHandleRegistration(outboundQueueHandlerRegistration);
final DeviceContext deviceContext = new DeviceContextImpl(connectionContext, dataBroker, messageSpy, translatorLibrary, convertorExecutor, config.isSkipTableFeatures(), hashedWheelTimer, config.isUseSingleLayerSerialization(), deviceInitializerProvider, config.isEnableFlowRemovedNotification(), config.isSwitchFeaturesMandatory(), contextChainHolder);
((ExtensionConverterProviderKeeper) deviceContext).setExtensionConverterProvider(extensionConverterProvider);
deviceContext.setNotificationPublishService(notificationPublishService);
deviceContexts.put(connectionContext.getDeviceInfo(), deviceContext);
updatePacketInRateLimiters();
final OpenflowProtocolListenerFullImpl messageListener = new OpenflowProtocolListenerFullImpl(connectionContext.getConnectionAdapter(), deviceContext);
connectionContext.getConnectionAdapter().setMessageListener(messageListener);
connectionContext.getConnectionAdapter().setAlienMessageListener(messageListener);
return deviceContext;
}
Aggregations