+++ /dev/null
-/*
- * Copyright (c) 2018 Red Hat, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.spi.connection;
-
-import com.google.common.collect.ForwardingList;
-import java.util.List;
-
-/**
- * {@link List} of {@link SwitchConnectionProvider}.
- * This is useful for strongly typed dependency injection,
- * and makes it simpler to have a common single source of truth
- * between Blueprint and other DI frameworks in a standalone environment.
- *
- * @author Michael Vorburger.ch
- */
-public class SwitchConnectionProviderList extends ForwardingList<SwitchConnectionProvider> {
-
- private final List<SwitchConnectionProvider> switchConnectionProviders;
-
- public SwitchConnectionProviderList(List<SwitchConnectionProvider> switchConnectionProviders) {
- this.switchConnectionProviders = switchConnectionProviders;
- }
-
- @Override
- protected List<SwitchConnectionProvider> delegate() {
- return switchConnectionProviders;
- }
-}
</bean>
<service ref="legacySwitchConnProvider" interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider"
odl:type="openflow-switch-connection-provider-legacy-impl"/>
-
- <bean id="switchConnectionProviders" class="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderList">
- <argument>
- <list>
- <ref component-id="defaultSwitchConnProvider"/>
- <ref component-id="legacySwitchConnProvider"/>
- </list>
- </argument>
- </bean>
- <service ref="switchConnectionProviders" interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderList"/>
</blueprint>
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
-import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderList;
import org.opendaylight.openflowplugin.api.openflow.FlowGroupInfoHistories;
import org.opendaylight.openflowplugin.api.openflow.FlowGroupInfoHistory;
import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider;
@Inject
public OpenFlowPluginProviderImpl(final ConfigurationService configurationService,
- final SwitchConnectionProviderList switchConnectionProviders,
+ final List<SwitchConnectionProvider> switchConnectionProviders,
final PingPongDataBroker pingPongDataBroker,
final RpcProviderService rpcProviderRegistry,
final NotificationPublishService notificationPublishService,
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+ xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
odl:use-default-for-reference-types="true">
<bean id="openFlowPluginProviderImpl"
init-method="initialize"
destroy-method="close">
<argument ref="configurationService"/>
- <argument ref="switchConnectionProviderList"/>
+ <argument>
+ <list>
+ <ref component-id="defaultSwitchConnProvider"/>
+ <ref component-id="legacySwitchConnProvider"/>
+ </list>
+ </argument>
<argument ref="pingPongDataBroker"/>
<argument ref="rpcProviderService"/>
<argument ref="notificationPublishService"/>
<reference id="ppDB"
interface="org.opendaylight.mdsal.binding.api.DataBroker"/>
- <reference id="switchConnectionProviderList"
- interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderList"
- ext:proxy-method="classes"/>
+ <reference id="defaultSwitchConnProvider"
+ interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider"
+ odl:type="openflow-switch-connection-provider-default-impl"/>
+ <reference id="legacySwitchConnProvider"
+ interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider"
+ odl:type="openflow-switch-connection-provider-legacy-impl"/>
<reference id="rpcProviderService"
interface="org.opendaylight.mdsal.binding.api.RpcProviderService"/>
<reference id="notificationPublishService"
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import com.google.common.collect.Lists;
import com.google.common.util.concurrent.Futures;
+import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
import org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider;
import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
-import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderList;
import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationProperty;
import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService;
import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager;
public void testInitializeAndClose() {
final OpenFlowPluginProviderImpl provider = new OpenFlowPluginProviderImpl(
configurationService,
- new SwitchConnectionProviderList(Lists.newArrayList(switchConnectionProvider)),
+ List.of(switchConnectionProvider),
dataBroker,
rpcProviderRegistry,
notificationPublishService,