import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
-import org.opendaylight.openflowplugin.openflow.md.OFConstants;
+import org.opendaylight.openflowplugin.api.OFConstants;
+import org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey;
+import org.opendaylight.openflowplugin.openflow.md.core.extension.ExtensionConverterProvider;
import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
import org.opendaylight.openflowplugin.openflow.md.core.translator.ErrorTranslator;
import org.opendaylight.openflowplugin.openflow.md.core.translator.ErrorV10Translator;
import org.opendaylight.openflowplugin.openflow.md.core.translator.PacketInV10Translator;
import org.opendaylight.openflowplugin.openflow.md.core.translator.PortStatusMessageToNodeConnectorUpdatedTranslator;
import org.opendaylight.openflowplugin.openflow.md.lldp.LLDPSpeakerPopListener;
-import org.opendaylight.openflowplugin.openflow.md.queue.MessageSpy;
import org.opendaylight.openflowplugin.openflow.md.queue.PopListener;
+import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
+import org.opendaylight.openflowplugin.api.statistics.MessageSpy;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeErrorNotification;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SwitchFlowRemoved;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsUpdate;
private ErrorHandlerSimpleImpl errorHandler;
+ private ExtensionConverterProvider extensionConverterProvider;
+
/**
* @return translator mapping
*/
*/
public void init() {
LOG.debug("init");
+
+ OpenflowPortsUtil.init();
+
messageTranslators = new ConcurrentHashMap<>();
popListeners = new ConcurrentHashMap<>();
//TODO: move registration to factory
int rpcThreadLimit = 10;
ListeningExecutorService rpcPoolDelegator = createRpcPoolSpyDecorated(rpcThreadLimit, messageSpyCounter);
OFSessionUtil.getSessionManager().setRpcPool(rpcPoolDelegator);
+ OFSessionUtil.getSessionManager().setExtensionConverterProvider(extensionConverterProvider);
}
};
ThreadPoolLoggingExecutor rpcPool = new ThreadPoolLoggingExecutor(rpcThreadLimit, rpcThreadLimit, 0L,
- TimeUnit.MILLISECONDS, queue);
+ TimeUnit.MILLISECONDS, queue, "OFRpc");
rpcPool.setRejectedExecutionHandler(new RejectedExecutionHandler() {
@Override
public void rejectedExecution(final Runnable r, final ThreadPoolExecutor executor) {
switchConnectionPrv.setSwitchConnectionHandler(null);
}
switchConnectionProviders = null;
+ OpenflowPortsUtil.close();
OFSessionUtil.releaseSessionManager();
errorHandler = null;
}
+
+ /**
+ * @param extensionConverterProvider
+ */
+ public void setExtensionConverterProvider(ExtensionConverterProvider extensionConverterProvider) {
+ this.extensionConverterProvider = extensionConverterProvider;
+ }
}