rewrite ofp-He to direct access md-sal services 06/19106/2
authorMartin Bobak <mbobak@cisco.com>
Sun, 26 Apr 2015 14:24:49 +0000 (16:24 +0200)
committerMartin Bobak <mbobak@cisco.com>
Sun, 26 Apr 2015 17:34:39 +0000 (19:34 +0200)
 - till now ofplugin used general BindingBroker to access
   services
 - adjusted service parameters format

Change-Id: Iea6338a77b9dd03772c5146ba94ba9ffffd6977e
Signed-off-by: Martin Bobak <mbobak@cisco.com>
12 files changed:
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/md/ModelDrivenSwitch.java
openflowplugin-controller-config/src/main/resources/initial/42-openflowplugin.xml
openflowplugin-it/src/test/resources/controller.xml
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/AbstractModelDrivenSwitch.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OpenflowPluginProvider.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/SalRegistrationManager.java
openflowplugin/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/common/config/impl/rev140326/ConfigurableOpenFlowProviderModule.java
openflowplugin/src/main/yang/openflow-plugin-cfg-impl.yang
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/ConcurrentSalRegistrationManagerTest.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OpenflowPluginProviderTest.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/SalRegistrationManagerTest.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/session/SessionManagerOFImplTest.java

index 35f41dc11f9a464f371c5367773f5abd1b6426eb..98774acd42f4cf18193bbf869a899f80ed7f2038 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.api.openflow.md;
 
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
@@ -41,10 +41,10 @@ public interface ModelDrivenSwitch
         Identifiable<InstanceIdentifier<Node>> {
 
     /**
-     * @param ctx
+     * @param rpcProviderRegistry
      * @return wrapped list of {service provider + path} registration couples
      */
-    CompositeObjectRegistration<ModelDrivenSwitch> register(ProviderContext ctx);
+    CompositeObjectRegistration<ModelDrivenSwitch> register(RpcProviderRegistry rpcProviderRegistry);
 
     /**
      * @return id of encapsulated node (served by this impl)
index b3a243a0208e0781452fef808936f6a296317e27..132028ed4e05db16c4d8b53b7f1f8309061124aa 100644 (file)
@@ -104,11 +104,19 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
             <name>openflow-switch-connection-provider-legacy</name>
           </openflow-switch-connection-provider>
 
+            <data-broker>
+                <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
+                <name>pingpong-binding-data-broker</name>
+            </data-broker>
+            <rpc-registry>
+                <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
+                <name>binding-rpc-broker</name>
+            </rpc-registry>
+            <notification-service>
+                <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
+                <name>binding-notification-broker</name>
+            </notification-service>
 
-          <binding-aware-broker>
-            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
-            <name>binding-osgi-broker</name>
-          </binding-aware-broker>
         </module>
       </modules>
 
index 7163c2063eb03d296aa86440c093677060eb1358..6774ccc43c1854d1df2576e2619ded017f7ba61a 100644 (file)
                             <name>openflow-switch-connection-provider-legacy</name>
                           </openflow-switch-connection-provider>
 
-                            <binding-aware-broker>
-                            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
-                            <name>binding-osgi-broker</name>
-                          </binding-aware-broker>
+                            <data-broker>
+                                <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
+                                <name>pingpong-binding-data-broker</name>
+                            </data-broker>
+                            <rpc-registry>
+                                <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
+                                <name>binding-rpc-broker</name>
+                            </rpc-registry>
+                            <notification-service>
+                                <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
+                                <name>binding-notification-broker</name>
+                            </notification-service>
                         </module>
 
 
index 4cc5bc73c2523f701a8dae35906f6b05e11df77c..2b50650b0edb83d3125e2a8617be2c66321b8108 100644 (file)
@@ -7,8 +7,8 @@
  */
 package org.opendaylight.openflowplugin.openflow.md.core.sal;
 
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.openflowplugin.api.openflow.md.ModelDrivenSwitch;
 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
@@ -50,59 +50,59 @@ public abstract class AbstractModelDrivenSwitch implements ModelDrivenSwitch {
     }
 
     @Override
-    public CompositeObjectRegistration<ModelDrivenSwitch> register(ProviderContext ctx) {
+    public CompositeObjectRegistration<ModelDrivenSwitch> register(RpcProviderRegistry rpcProviderRegistry) {
         CompositeObjectRegistrationBuilder<ModelDrivenSwitch> builder = CompositeObjectRegistration
                 .<ModelDrivenSwitch> builderFor(this);
 
-        final RoutedRpcRegistration<SalFlowService> flowRegistration = ctx.addRoutedRpcImplementation(SalFlowService.class, this);
+        final RoutedRpcRegistration<SalFlowService> flowRegistration = rpcProviderRegistry.addRoutedRpcImplementation(SalFlowService.class, this);
         flowRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(flowRegistration);
 
-        final RoutedRpcRegistration<SalPortService> portRegistration = ctx.addRoutedRpcImplementation(SalPortService.class, this);
+        final RoutedRpcRegistration<SalPortService> portRegistration = rpcProviderRegistry.addRoutedRpcImplementation(SalPortService.class, this);
         portRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(portRegistration);
 
-        final RoutedRpcRegistration<SalMeterService> meterRegistration = ctx.addRoutedRpcImplementation(SalMeterService.class, this);
+        final RoutedRpcRegistration<SalMeterService> meterRegistration = rpcProviderRegistry.addRoutedRpcImplementation(SalMeterService.class, this);
         meterRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(meterRegistration);
 
-        final RoutedRpcRegistration<SalGroupService> groupRegistration = ctx.addRoutedRpcImplementation(SalGroupService.class, this);
+        final RoutedRpcRegistration<SalGroupService> groupRegistration = rpcProviderRegistry.addRoutedRpcImplementation(SalGroupService.class, this);
         groupRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(groupRegistration);
 
-        final RoutedRpcRegistration<SalTableService> tableRegistration = ctx.addRoutedRpcImplementation(SalTableService.class, this);
+        final RoutedRpcRegistration<SalTableService> tableRegistration = rpcProviderRegistry.addRoutedRpcImplementation(SalTableService.class, this);
         tableRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(tableRegistration);
 
-        final RoutedRpcRegistration<PacketProcessingService> packetRegistration = ctx.addRoutedRpcImplementation(PacketProcessingService.class, this);
+        final RoutedRpcRegistration<PacketProcessingService> packetRegistration = rpcProviderRegistry.addRoutedRpcImplementation(PacketProcessingService.class, this);
         packetRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(packetRegistration);
 
-        final RoutedRpcRegistration<OpendaylightFlowStatisticsService> flowStatisticsRegistration = ctx.addRoutedRpcImplementation(OpendaylightFlowStatisticsService.class, this);
+        final RoutedRpcRegistration<OpendaylightFlowStatisticsService> flowStatisticsRegistration = rpcProviderRegistry.addRoutedRpcImplementation(OpendaylightFlowStatisticsService.class, this);
         flowStatisticsRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(flowStatisticsRegistration);
 
-        final RoutedRpcRegistration<OpendaylightGroupStatisticsService> groupStatisticsRegistration = ctx.addRoutedRpcImplementation(OpendaylightGroupStatisticsService.class, this);
+        final RoutedRpcRegistration<OpendaylightGroupStatisticsService> groupStatisticsRegistration = rpcProviderRegistry.addRoutedRpcImplementation(OpendaylightGroupStatisticsService.class, this);
         groupStatisticsRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(groupStatisticsRegistration);
 
-        final RoutedRpcRegistration<OpendaylightMeterStatisticsService> meterStatisticsRegistration = ctx.addRoutedRpcImplementation(OpendaylightMeterStatisticsService.class, this);
+        final RoutedRpcRegistration<OpendaylightMeterStatisticsService> meterStatisticsRegistration = rpcProviderRegistry.addRoutedRpcImplementation(OpendaylightMeterStatisticsService.class, this);
         meterStatisticsRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(meterStatisticsRegistration);
 
-        final RoutedRpcRegistration<OpendaylightPortStatisticsService> portStatisticsRegistration = ctx.addRoutedRpcImplementation(OpendaylightPortStatisticsService.class, this);
+        final RoutedRpcRegistration<OpendaylightPortStatisticsService> portStatisticsRegistration = rpcProviderRegistry.addRoutedRpcImplementation(OpendaylightPortStatisticsService.class, this);
         portStatisticsRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(portStatisticsRegistration);
 
-        final RoutedRpcRegistration<NodeConfigService> nodeConfigRegistration = ctx.addRoutedRpcImplementation(NodeConfigService.class, this);
+        final RoutedRpcRegistration<NodeConfigService> nodeConfigRegistration = rpcProviderRegistry.addRoutedRpcImplementation(NodeConfigService.class, this);
         nodeConfigRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(nodeConfigRegistration);
 
-        final RoutedRpcRegistration<OpendaylightFlowTableStatisticsService> flowTableStatisticsRegistration = ctx.addRoutedRpcImplementation(OpendaylightFlowTableStatisticsService.class, this);
+        final RoutedRpcRegistration<OpendaylightFlowTableStatisticsService> flowTableStatisticsRegistration = rpcProviderRegistry.addRoutedRpcImplementation(OpendaylightFlowTableStatisticsService.class, this);
         flowTableStatisticsRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(flowTableStatisticsRegistration);
 
-        final RoutedRpcRegistration<OpendaylightQueueStatisticsService> queueStatisticsRegistration = ctx.addRoutedRpcImplementation(OpendaylightQueueStatisticsService.class, this);
+        final RoutedRpcRegistration<OpendaylightQueueStatisticsService> queueStatisticsRegistration = rpcProviderRegistry.addRoutedRpcImplementation(OpendaylightQueueStatisticsService.class, this);
         queueStatisticsRegistration.registerPath(NodeContext.class, getIdentifier());
         builder.add(queueStatisticsRegistration);
 
@@ -110,7 +110,7 @@ public abstract class AbstractModelDrivenSwitch implements ModelDrivenSwitch {
     }
 
     /**
-     * @return session context 
+     * @return session context
      */
     public SessionContext getSessionContext() {
         return sessionContext;
index 570dc5466ca28d6514025acde8d1b4c22c081751..2d488dc5c90fde280863b18e9fe51774fc1d89a8 100644 (file)
@@ -7,10 +7,11 @@
  */
 package org.opendaylight.openflowplugin.openflow.md.core.sal;
 
+import com.google.common.annotations.VisibleForTesting;
 import java.util.Collection;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
 import org.opendaylight.openflowplugin.api.openflow.statistics.MessageCountDumper;
 import org.opendaylight.openflowplugin.api.openflow.statistics.MessageObservatory;
@@ -24,21 +25,16 @@ import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
 import org.opendaylight.openflowplugin.statistics.MessageSpyCounterImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.common.config.impl.rev140326.OfpRole;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
-import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * OFPlugin provider implementation
  */
-public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseable, OpenFlowPluginExtensionRegistratorProvider {
+public class OpenflowPluginProvider implements AutoCloseable, OpenFlowPluginExtensionRegistratorProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginProvider.class);
 
-    private BindingAwareBroker broker;
-
-    private BundleContext context;
-
     private Collection<SwitchConnectionProvider> switchConnectionProviders;
 
     private MDController mdController;
@@ -52,6 +48,9 @@ public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseab
     private OfpRole role;
 
     private OFRoleManager roleManager;
+    private DataBroker dataBroker;
+    private NotificationProviderService notificationService;
+    private RpcProviderRegistry rpcRegistry;
 
     /**
      * Initialization of services and msgSpy counter
@@ -60,28 +59,14 @@ public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseab
         messageCountProvider = new MessageSpyCounterImpl();
         extensionConverterManager = new ExtensionConverterManagerImpl();
         roleManager = new OFRoleManager(OFSessionUtil.getSessionManager());
-        this.registerProvider();
-    }
-
-    /**
-     * @param switchConnectionProvider
-     */
-    public void setSwitchConnectionProviders(Collection<SwitchConnectionProvider> switchConnectionProvider) {
-        this.switchConnectionProviders = switchConnectionProvider;
-    }
-
-    /**
-     * @return osgi context
-     */
-    public BundleContext getContext() {
-        return context;
-    }
 
-    @Override
-    public void onSessionInitiated(ProviderContext session) {
-        LOG.debug("onSessionInitiated");
+        LOG.debug("dependencies gathered..");
         registrationManager = new SalRegistrationManager();
-        registrationManager.onSessionInitiated(session);
+        registrationManager.setDataService(dataBroker);
+        registrationManager.setPublishService(notificationService);
+        registrationManager.setRpcProviderRegistry(rpcRegistry);
+        registrationManager.init();
+
         mdController = new MDController();
         mdController.setSwitchConnectionProviders(switchConnectionProviders);
         mdController.setMessageSpyCounter(messageCountProvider);
@@ -90,6 +75,13 @@ public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseab
         mdController.start();
     }
 
+    /**
+     * @param switchConnectionProvider
+     */
+    public void setSwitchConnectionProviders(Collection<SwitchConnectionProvider> switchConnectionProvider) {
+        this.switchConnectionProviders = switchConnectionProvider;
+    }
+
     @Override
     public void close() {
         LOG.debug("close");
@@ -99,47 +91,6 @@ public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseab
         registrationManager = null;
     }
 
-    /**
-     * @return BA default broker
-     */
-    public BindingAwareBroker getBroker() {
-        return broker;
-    }
-
-    /**
-     * dependencymanager requirement
-     *
-     * @param broker
-     */
-    public void setBroker(BindingAwareBroker broker) {
-        this.broker = broker;
-    }
-
-    /**
-     * dependencymanager requirement
-     *
-     * @param brokerArg
-     */
-    public void unsetBroker(BindingAwareBroker brokerArg) {
-        this.broker = null;
-    }
-
-    private boolean hasAllDependencies() {
-        if (this.broker != null && this.switchConnectionProviders != null) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * register providers for md-sal
-     */
-    private void registerProvider() {
-        if (hasAllDependencies()) {
-            this.broker.registerProvider(this, context);
-        }
-    }
-
     public MessageCountDumper getMessageCountDumper() {
         return messageCountProvider;
     }
@@ -185,4 +136,31 @@ public class OpenflowPluginProvider implements BindingAwareProvider, AutoCloseab
             }
         }
     }
+
+    public void setDataBroker(DataBroker dataBroker) {
+        this.dataBroker = dataBroker;
+    }
+
+    public void setNotificationService(NotificationProviderService notificationService) {
+        this.notificationService = notificationService;
+    }
+
+    public void setRpcRegistry(RpcProviderRegistry rpcRegistry) {
+        this.rpcRegistry = rpcRegistry;
+    }
+
+    @VisibleForTesting
+    protected RpcProviderRegistry getRpcRegistry() {
+        return rpcRegistry;
+    }
+
+    @VisibleForTesting
+    protected NotificationProviderService getNotificationService() {
+        return notificationService;
+    }
+
+    @VisibleForTesting
+    protected DataBroker getDataBroker() {
+        return dataBroker;
+    }
 }
index 02d60ac1109a5def49f06e7510dfb185bb0e707f..25e29aba26632fdf1c2e0c752f9616de86afd392 100644 (file)
@@ -14,15 +14,15 @@ import java.net.Inet6Address;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.openflowplugin.api.openflow.md.ModelDrivenSwitch;
 import org.opendaylight.openflowplugin.api.openflow.md.core.NotificationQueueWrapper;
-import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionListener;
 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionManager;
 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SwitchSessionKeyOF;
+import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
@@ -52,12 +52,12 @@ public class SalRegistrationManager implements SessionListener, AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(SalRegistrationManager.class);
 
-    private ProviderContext providerContext;
-
     private NotificationProviderService publishService;
 
     private DataBroker dataService;
 
+    private RpcProviderRegistry rpcProviderRegistry;
+
     private SwitchFeaturesUtil swFeaturesUtil;
 
     private ListenerRegistration<SessionListener> sessionListenerRegistration;
@@ -74,16 +74,16 @@ public class SalRegistrationManager implements SessionListener, AutoCloseable {
         this.publishService = publishService;
     }
 
-    public ProviderContext getProviderContext() {
-        return providerContext;
+    public void setDataService(DataBroker dataService) {
+        this.dataService = dataService;
     }
 
-    public void onSessionInitiated(ProviderContext session) {
-        LOG.debug("onSessionInitiated");
-        this.providerContext = session;
-        this.publishService = session.getSALService(NotificationProviderService.class);
-        this.dataService = session.getSALService(DataBroker.class);
-        // We register as listener for Session Manager
+    public void setRpcProviderRegistry(RpcProviderRegistry rpcProviderRegistry) {
+        this.rpcProviderRegistry = rpcProviderRegistry;
+    }
+
+    public void init() {
+        LOG.debug("init..");
         sessionListenerRegistration = getSessionManager().registerSessionListener(this);
         getSessionManager().setNotificationProviderService(publishService);
         getSessionManager().setDataBroker(dataService);
@@ -98,10 +98,11 @@ public class SalRegistrationManager implements SessionListener, AutoCloseable {
         NodeRef nodeRef = new NodeRef(identifier);
         NodeId nodeId = nodeIdFromDatapathId(datapathId);
         ModelDrivenSwitchImpl ofSwitch = new ModelDrivenSwitchImpl(nodeId, identifier, context);
-        CompositeObjectRegistration<ModelDrivenSwitch> registration = ofSwitch.register(providerContext);
+        CompositeObjectRegistration<ModelDrivenSwitch> registration =
+                ofSwitch.register(rpcProviderRegistry);
         context.setProviderRegistration(registration);
 
-        LOG.debug("ModelDrivenSwitch for {} registered to MD-SAL.", datapathId.toString());
+        LOG.debug("ModelDrivenSwitch for {} registered to MD-SAL.", datapathId);
 
         NotificationQueueWrapper wrappedNotification = new NotificationQueueWrapper(
                 nodeAdded(ofSwitch, features, nodeRef),
@@ -122,7 +123,7 @@ public class SalRegistrationManager implements SessionListener, AutoCloseable {
             registration.close();
             context.setProviderRegistration(null);
         }
-        LOG.debug("ModelDrivenSwitch for {} unregistered from MD-SAL.", datapathId.toString());
+        LOG.debug("ModelDrivenSwitch for {} unregistered from MD-SAL.", datapathId);
 
         NotificationQueueWrapper wrappedNotification = new NotificationQueueWrapper(
                 nodeRemoved, context.getFeatures().getVersion());
@@ -190,7 +191,7 @@ public class SalRegistrationManager implements SessionListener, AutoCloseable {
 
     public static NodeId nodeIdFromDatapathId(BigInteger datapathId) {
         // FIXME: Convert to textual representation of datapathID
-        String current = datapathId.toString();
+        String current = String.valueOf(datapathId);
         return new NodeId("openflow:" + current);
     }
 
@@ -202,17 +203,10 @@ public class SalRegistrationManager implements SessionListener, AutoCloseable {
     public void close() {
         LOG.debug("close");
         dataService = null;
-        providerContext = null;
+        rpcProviderRegistry = null;
         publishService = null;
         if (sessionListenerRegistration != null) {
             sessionListenerRegistration.close();
         }
     }
-
-    /**
-     * @param providerContext the providerContext to set
-     */
-    public void setProviderContext(ProviderContext providerContext) {
-        this.providerContext = providerContext;
-    }
 }
index fbc87643b57460967695d5eee5baccd98911b2f1..26fefeb01a9841e22a978f295d9e4166c4f09947 100644 (file)
@@ -9,12 +9,10 @@
 */
 package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.common.config.impl.rev140326;
 
+import com.google.common.base.MoreObjects;
 import javax.management.ObjectName;
-
 import org.opendaylight.openflowplugin.openflow.md.core.sal.OpenflowPluginProvider;
 
-import com.google.common.base.MoreObjects;
-
 /**
 *
 */
@@ -50,7 +48,9 @@ public final class ConfigurableOpenFlowProviderModule extends org.opendaylight.y
     @Override
     public java.lang.AutoCloseable createInstance() {
         pluginProvider =  new OpenflowPluginProvider();
-        pluginProvider.setBroker(getBindingAwareBrokerDependency());
+        pluginProvider.setDataBroker(getDataBrokerDependency());
+        pluginProvider.setNotificationService(getNotificationServiceDependency());
+        pluginProvider.setRpcRegistry(getRpcRegistryDependency());
         pluginProvider.setSwitchConnectionProviders(getOpenflowSwitchConnectionProviderDependency());
         pluginProvider.setRole(getRole());
         pluginProvider.initialization();
@@ -63,10 +63,15 @@ public final class ConfigurableOpenFlowProviderModule extends org.opendaylight.y
         // we can reuse if only the role field changed
         boolean noChangeExceptRole = true;
         noChangeExceptRole &= dependencyResolver.canReuseDependency(
-                getBindingAwareBroker(), bindingAwareBrokerJmxAttribute);
+                getDataBroker(), dataBrokerJmxAttribute);
+        noChangeExceptRole &= dependencyResolver.canReuseDependency(
+                getNotificationService(), notificationServiceJmxAttribute);
+        noChangeExceptRole &= dependencyResolver.canReuseDependency(
+                getRpcRegistry(), rpcRegistryJmxAttribute);
+
         for (ObjectName ofSwitchProvider : getOpenflowSwitchConnectionProvider()) {
             noChangeExceptRole &= dependencyResolver.canReuseDependency(
-                    ofSwitchProvider, openflowSwitchConnectionProviderJmxAttribute); 
+                    ofSwitchProvider, openflowSwitchConnectionProviderJmxAttribute);
         }
         return noChangeExceptRole;
     }
index 2afdd1be2b5d39b794402849a7607a3f6e30e7ea..83c62f11b54a343b36f63f32155d7d165b26ee1f 100644 (file)
@@ -59,14 +59,31 @@ module openflow-provider-impl {
         case openflow-provider-impl {
             when "/config:modules/config:module/config:type = 'openflow-provider-impl'";
 
-            container binding-aware-broker {
+            container data-broker {
                 uses config:service-ref {
                     refine type {
                         mandatory true;
-                        config:required-identity md-sal-binding:binding-broker-osgi-registry;
+                        config:required-identity md-sal-binding:binding-async-data-broker;
                     }
                 }
             }
+            container rpc-registry {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity md-sal-binding:binding-rpc-registry;
+                    }
+                }
+            }
+            container notification-service {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity md-sal-binding:binding-notification-service;
+                    }
+                }
+            }
+
             list openflow-switch-connection-provider {
                 uses config:service-ref {
                     refine type {
index d59872c56270f09511ea1adc454df97bf2526937..bf0ba5a297a857edc439e8d45d262f75853d035d 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.openflowplugin.openflow.md.core.sal;
 
+import com.google.common.util.concurrent.ListeningExecutorService;
 import java.math.BigInteger;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
@@ -20,7 +21,6 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -32,17 +32,18 @@ import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.mockito.stubbing.Answer;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.md.core.ConnectionConductor;
 import org.opendaylight.openflowplugin.api.openflow.md.core.NotificationEnqueuer;
-import org.opendaylight.openflowplugin.openflow.md.core.ThreadPoolLoggingExecutor;
-import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
 import org.opendaylight.openflowplugin.api.openflow.md.core.session.SwitchSessionKeyOF;
+import org.opendaylight.openflowplugin.openflow.md.core.ThreadPoolLoggingExecutor;
+import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Capabilities;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutputBuilder;
@@ -50,8 +51,6 @@ import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.util.concurrent.ListeningExecutorService;
-
 /**
  * Created by Martin Bobak mbobak@cisco.com on 9/22/14.
  */
@@ -76,11 +75,13 @@ public class ConcurrentSalRegistrationManagerTest {
     @Mock
     private ConnectionConductor connectionConductor;
     @Mock
-    private ListeningExecutorService rpcPool; 
+    private ListeningExecutorService rpcPool;
+    @Mock
+    private NotificationProviderService notificationProviderService;
     @Mock
-    private NotificationProviderService notificationProviderService; 
+    private RpcProviderRegistry rpcProviderRegistry;
     @Mock
-    private ProviderContext providerContext;
+    private DataBroker dataBroker;
     @Mock
     private NotificationEnqueuer notificationEnqueuer;
     @Mock
@@ -94,9 +95,8 @@ public class ConcurrentSalRegistrationManagerTest {
     @Before
     public void setUp() {
         SWITCH_SESSION_KEY_OF.setDatapathId(BigInteger.ONE);
-        Mockito.when(providerContext.getSALService(NotificationProviderService.class)).thenReturn(notificationProviderService);
         Mockito.when(context.getNotificationEnqueuer()).thenReturn(notificationEnqueuer);
-        
+
         // features mockery
         features = new GetFeaturesOutputBuilder()
         .setVersion(OFConstants.OFP_VERSION_1_3)
@@ -104,13 +104,13 @@ public class ConcurrentSalRegistrationManagerTest {
         .setCapabilities(new Capabilities(true, true, true, true, true, true, true))
         .build();
         Mockito.when(context.getFeatures()).thenReturn(features);
-        
+
         Mockito.when(context.getPrimaryConductor()).thenReturn(connectionConductor);
         Mockito.when(context.getSessionKey()).thenReturn(SWITCH_SESSION_KEY_OF);
         Mockito.when(connectionConductor.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
-        
+
         // provider context - registration responder
-        Mockito.when(providerContext.addRoutedRpcImplementation(Matchers.any(Class.class), Matchers.any(RpcService.class)))
+        Mockito.when(rpcProviderRegistry.addRoutedRpcImplementation(Matchers.any(Class.class), Matchers.any(RpcService.class)))
         .then(new Answer<RoutedRpcRegistration<?>>() {
             @Override
             public RoutedRpcRegistration<?> answer(InvocationOnMock invocation) {
@@ -122,44 +122,47 @@ public class ConcurrentSalRegistrationManagerTest {
                         LOG.error("delaying of worker thread [{}] failed.", Thread.currentThread().getName(), e);
                     }
                 }
-                
+
                 Object[] args = invocation.getArguments();
                 RoutedRpcRegistration<RpcService> registration = Mockito.mock(RoutedRpcRegistration.class);
                 Mockito.when(registration.getInstance()).thenReturn((RpcService) args[1]);
-                
+
                 return registration;
             }
         });
-        
+
         Mockito.when(connectionConductor.getConnectionAdapter()).thenReturn(connectionAdapter);
         Mockito.when(connectionAdapter.getRemoteAddress()).thenReturn(new InetSocketAddress("10.1.2.3", 4242));
-        
+
         taskExecutor = new ThreadPoolCollectingExecutor(
                 2, 2, 0, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(2), "junit");
-        
-        registrationManager.onSessionInitiated(providerContext);
+
+        registrationManager.setRpcProviderRegistry(rpcProviderRegistry);
+        registrationManager.setDataService(dataBroker);
+        registrationManager.setPublishService(notificationProviderService);
+        registrationManager.init();
         OFSessionUtil.getSessionManager().setRpcPool(rpcPool);
     }
-    
+
     /**
      * clean up
-     * @throws InterruptedException 
+     * @throws InterruptedException
      */
     @After
     public void tearDown() throws InterruptedException {
         taskExecutor.shutdown();
         taskExecutor.awaitTermination(1, TimeUnit.SECONDS);
         if (!taskExecutor.isTerminated()) {
-           taskExecutor.shutdownNow(); 
+            taskExecutor.shutdownNow();
         }
         LOG.info("All tasks have finished.");
-        
-        LOG.info("amount of scheduled threads: {}, exited threads: {}, failed threads: {}", 
+
+        LOG.info("amount of scheduled threads: {}, exited threads: {}, failed threads: {}",
                 taskExecutor.getTaskCount(), taskExecutor.getThreadExitCounter(), taskExecutor.getFailLogbook().size());
         for (String exitStatus : taskExecutor.getFailLogbook()) {
             LOG.debug(exitStatus);
         }
-        
+
         OFSessionUtil.releaseSessionManager();
         Assert.assertTrue("there should not be any failed threads in the pool", taskExecutor.getFailLogbook().isEmpty());
         Assert.assertTrue("there should not be any living thread in the pool", taskExecutor.getActiveCount() == 0);
@@ -167,9 +170,9 @@ public class ConcurrentSalRegistrationManagerTest {
 
     /**
      * Test method which verifies that session could not be invalidated while in creation.
-     * @throws InterruptedException 
-     * @throws TimeoutException 
-     * @throws ExecutionException 
+     * @throws InterruptedException
+     * @throws TimeoutException
+     * @throws ExecutionException
      */
     @Test
     public void testConcurrentRemoveSessionContext() throws InterruptedException, ExecutionException, TimeoutException {
@@ -195,16 +198,16 @@ public class ConcurrentSalRegistrationManagerTest {
                 return null;
             }
         };
-        
+
         Future<Void> addSessionResult = taskExecutor.submit(delayedThread);
         Future<Void> removeSessionResult = taskExecutor.submit(noDelayThread);
-        
+
         addSessionResult.get(REGISTRATION_ACTION_TIMEOUT, TimeUnit.SECONDS);
         removeSessionResult.get(REGISTRATION_ACTION_TIMEOUT, TimeUnit.SECONDS);
     }
 
     private static class ThreadPoolCollectingExecutor extends ThreadPoolLoggingExecutor {
-        
+
         private List<String> failLogbook;
         private int threadExitCounter = 0;
 
@@ -220,27 +223,27 @@ public class ConcurrentSalRegistrationManagerTest {
                 int maximumPoolSize, long keepAliveTime, TimeUnit unit,
                 BlockingQueue<Runnable> workQueue, String poolName) {
             super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, poolName);
-            
+
             failLogbook = Collections.synchronizedList(new ArrayList<String>());
         }
-        
+
         @Override
         protected void afterExecute(Runnable r, Throwable t) {
             super.afterExecute(r, t);
             threadExitCounter ++;
-            
+
             if (t != null) {
                 failLogbook.add("job ["+r+"] exited with throwable:" + t.getMessage());
             }
         }
-        
+
         /**
          * @return the chronicles
          */
         public List<String> getFailLogbook() {
             return failLogbook;
         }
-        
+
         /**
          * @return the threadExitCounter
          */
index edd5aee3ae667fa59f1fb190936fb0308b932b10..2438d70dad55d8068746fd2d3ddf1ceae99102c4 100644 (file)
@@ -9,14 +9,17 @@
 package org.opendaylight.openflowplugin.openflow.md.core.sal;\r
 \r
 \r
+import com.google.common.util.concurrent.Futures;
 import java.util.ArrayList;\r
-\r
 import org.junit.Assert;\r
 import org.junit.Before;\r
 import org.junit.Test;\r
 import org.mockito.Mock;\r
+import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;\r
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;\r
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;\r
 \r
 /**\r
@@ -25,8 +28,14 @@ import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionPro
  */\r
 public class OpenflowPluginProviderTest {\r
 \r
-    @Mock BindingAwareBroker baBroker;\r
-    @Mock SwitchConnectionProvider switchProvider;\r
+    @Mock
+    DataBroker dataBroker;
+    @Mock
+    NotificationProviderService notificationProviderService;
+    @Mock
+    RpcProviderRegistry rpcProviderRegistry;
+    @Mock
+    SwitchConnectionProvider switchProvider;
 \r
     OpenflowPluginProvider provider = new OpenflowPluginProvider();\r
 \r
@@ -44,15 +53,19 @@ public class OpenflowPluginProviderTest {
      */\r
     @Test\r
     public void testInitialization() {\r
+        Mockito.when(switchProvider.startup()).thenReturn(Futures.immediateFuture(Boolean.TRUE));
         ArrayList<SwitchConnectionProvider> switchProviders = new ArrayList<>();\r
         switchProviders.add(switchProvider);\r
         provider.setSwitchConnectionProviders(switchProviders);\r
-        provider.setBroker(baBroker);\r
+        provider.setDataBroker(dataBroker);
+        provider.setNotificationService(notificationProviderService);
+        provider.setRpcRegistry(rpcProviderRegistry);
         provider.initialization();\r
 \r
         Assert.assertNotNull("Wrong message count dumper", provider.getMessageCountDumper());\r
         Assert.assertNotNull("Wrong extension converter registrator", provider.getExtensionConverterRegistrator());\r
-        Assert.assertNull("Wrong context", provider.getContext());\r
-        Assert.assertNotNull("Wrong broker", provider.getBroker());\r
+        Assert.assertNotNull("Wrong data broker", provider.getDataBroker());
+        Assert.assertNotNull("Wrong notification service", provider.getNotificationService());
+        Assert.assertNotNull("Wrong rpc registry", provider.getRpcRegistry());
     }\r
 }
\ No newline at end of file
index 2047cb5047840d0589614aa01b63959bf16bd528..12c55cc6ef5918b27d393cf7b2ee88736e4a51bf 100644 (file)
@@ -25,8 +25,10 @@ import org.mockito.Matchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.runners.MockitoJUnitRunner;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.controller.sal.common.util.Rpcs;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.md.ModelDrivenSwitch;
@@ -76,6 +78,10 @@ public class SalRegistrationManagerTest {
     private ListeningExecutorService rpcPool;
     @Mock
     private NotificationProviderService notificationProviderService;
+    @Mock
+    private RpcProviderRegistry rpcProviderRegistry;
+    @Mock
+    private DataBroker dataBroker;
 
     private ModelDrivenSwitch mdSwitchOF13;
 
@@ -108,8 +114,11 @@ public class SalRegistrationManagerTest {
                         Matchers.any(SwitchConnectionDistinguisher.class))).thenReturn(Futures.immediateFuture(result));
 
         salRegistrationManager = new SalRegistrationManager();
-        salRegistrationManager.onSessionInitiated(providerContext);
         salRegistrationManager.setPublishService(notificationProviderService);
+        salRegistrationManager.setDataService(dataBroker);
+        salRegistrationManager.setRpcProviderRegistry(rpcProviderRegistry);
+
+        salRegistrationManager.init();
 
     }
 
index ce25ef35ec721444385fff1686e21af138faffe3..a8bb5d93e282ba164cad776ec3cb706c4ac5d90a 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.openflowplugin.openflow.md.core.session;
 
+import com.google.common.util.concurrent.ListeningExecutorService;
 import java.math.BigInteger;
 import java.net.InetSocketAddress;
-
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -22,9 +22,10 @@ import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.mockito.stubbing.Answer;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.openflowplugin.api.openflow.md.core.ConnectionConductor;
 import org.opendaylight.openflowplugin.api.openflow.md.core.NotificationEnqueuer;
@@ -39,14 +40,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yangtools.yang.binding.Notification;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 
-import com.google.common.util.concurrent.ListeningExecutorService;
-
 /**
  * test of {@link SessionManagerOFImpl}
  */
 @RunWith(MockitoJUnitRunner.class)
 public class SessionManagerOFImplTest {
-    
+
     private SessionManager sm;
     private SwitchSessionKeyOF sessionKey;
     @Mock
@@ -54,15 +53,17 @@ public class SessionManagerOFImplTest {
     @Mock
     private ConnectionConductor primaryConductor;
     @Mock
-    private ListeningExecutorService rpcPool; 
+    private ListeningExecutorService rpcPool;
     @Mock
-    private NotificationProviderService notificationProviderService; 
+    private NotificationProviderService notificationProviderService;
     @Mock
-    private ProviderContext providerContext;
+    private RpcProviderRegistry rpcProviderRegistry;
     @Mock
     private NotificationEnqueuer notificationEnqueuer;
     @Mock
     private ConnectionAdapter connectionAdapter;
+    @Mock
+    private DataBroker dataService;
 
     /**
      * prepare session manager
@@ -72,9 +73,9 @@ public class SessionManagerOFImplTest {
         // context
         Mockito.when(context.getPrimaryConductor()).thenReturn(primaryConductor);
         Mockito.when(context.getNotificationEnqueuer()).thenReturn(notificationEnqueuer);
-        
+
         // provider context - registration responder
-        Mockito.when(providerContext.addRoutedRpcImplementation(Matchers.any(Class.class), Matchers.any(RpcService.class)))
+        Mockito.when(rpcProviderRegistry.addRoutedRpcImplementation(Matchers.any(Class.class), Matchers.any(RpcService.class)))
         .then(new Answer<RoutedRpcRegistration<?>>() {
             @Override
             public RoutedRpcRegistration<?> answer(InvocationOnMock invocation) {
@@ -84,23 +85,24 @@ public class SessionManagerOFImplTest {
                 return registration;
             }
         });
-        
+
         // session listener - prepare registration and notification mockery
         SalRegistrationManager sessionListener = new SalRegistrationManager();
         sessionListener.setPublishService(notificationProviderService);
-        sessionListener.setProviderContext(providerContext);
-        
+        sessionListener.setRpcProviderRegistry(rpcProviderRegistry);
+        sessionListener.setDataService(dataService);
+
         // session manager (mimic SalRegistrationManager.onSessionInitiated())
         sm = SessionManagerOFImpl.getInstance();
         sm.setRpcPool(rpcPool);
         sm.registerSessionListener(sessionListener);
         sm.setNotificationProviderService(notificationProviderService);
-        
+
         // session key - switch id
         sessionKey = new SwitchSessionKeyOF();
         sessionKey.setDatapathId(BigInteger.valueOf(42));
     }
-    
+
     /**
      * free session manager
      */
@@ -111,7 +113,7 @@ public class SessionManagerOFImplTest {
     }
 
     /**
-     * Test method for {@link org.opendaylight.openflowplugin.openflow.md.core.session.SessionManagerOFImpl#addSessionContext(org.opendaylight.openflowplugin.openflow.md.core.session.SwitchSessionKeyOF, org.opendaylight.openflowplugin.openflow.md.core.session.SessionContext)}.
+     * Test method for {@link org.opendaylight.openflowplugin.openflow.md.core.session.SessionManagerOFImpl#addSessionContext(SwitchSessionKeyOF, SessionContext)}.
      */
     @Test
     public void testAddSessionContext() {
@@ -121,10 +123,10 @@ public class SessionManagerOFImplTest {
         Mockito.when(context.getFeatures()).thenReturn(featuresBld.build());
         Mockito.when(primaryConductor.getConnectionAdapter()).thenReturn(connectionAdapter);
         Mockito.when(connectionAdapter.getRemoteAddress()).thenReturn(new InetSocketAddress("10.1.2.3", 4242));
-        
+
         //test target
         sm.addSessionContext(sessionKey, context);
-        
+
         //capture
         ArgumentCaptor<NotificationQueueWrapper> notifCaptor = ArgumentCaptor.forClass(NotificationQueueWrapper.class);
         Mockito.verify(notificationEnqueuer).enqueueNotification(notifCaptor.capture());