Add blueprint wiring for the lithium OpenflowPluginProvider 46/38646/3
authorTom Pantelis <tpanteli@brocade.com>
Tue, 10 May 2016 09:10:31 +0000 (05:10 -0400)
committerAnil Vishnoi <vishnoianil@gmail.com>
Fri, 3 Jun 2016 08:09:11 +0000 (08:09 +0000)
Change-Id: I95d721e85f0116b7d83c6b2db475ddfc27aa70c9
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
12 files changed:
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/OpenFlowPluginProviderFactory.java [new file with mode: 0644]
openflowplugin-api/src/main/yang/openflow-provider-config.yang [new file with mode: 0644]
openflowplugin-api/src/main/yang/openflow-provider.yang
openflowplugin-blueprint-config/pom.xml [new file with mode: 0644]
openflowplugin-blueprint-config/src/main/resources/org/opendaylight/blueprint/openflowplugin.xml [new file with mode: 0644]
openflowplugin-controller-config/src/main/resources/initial/42-openflowplugin-new.xml
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderFactoryImpl.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/config/openflow/plugin/impl/rev150327/OpenFlowProviderModule.java
openflowplugin-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/config/openflow/plugin/impl/rev150327/OpenFlowProviderModuleFactory.java
openflowplugin-impl/src/main/resources/org/opendaylight/blueprint/commands.xml [moved from openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/commands.xml with 100% similarity]
openflowplugin-impl/src/main/resources/org/opendaylight/blueprint/openflowplugin-impl.xml [new file with mode: 0644]
pom.xml

diff --git a/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/OpenFlowPluginProviderFactory.java b/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/OpenFlowPluginProviderFactory.java
new file mode 100644 (file)
index 0000000..d5caf2d
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, 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.openflowplugin.api.openflow;
+
+import java.util.List;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
+import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig;
+
+/**
+ * Factory for creating OpenFlowPluginProvider instances.
+ *
+ * @author Thomas Pantelis
+ */
+public interface OpenFlowPluginProviderFactory {
+    OpenFlowPluginProvider newInstance(OpenflowProviderConfig providerConfig, DataBroker dataBroker,
+            RpcProviderRegistry rpcRegistry, NotificationService notificationService,
+            NotificationPublishService notificationPublishService,
+            EntityOwnershipService entityOwnershipService,
+            List<SwitchConnectionProvider> switchConnectionProviders);
+}
diff --git a/openflowplugin-api/src/main/yang/openflow-provider-config.yang b/openflowplugin-api/src/main/yang/openflow-provider-config.yang
new file mode 100644 (file)
index 0000000..481793e
--- /dev/null
@@ -0,0 +1,68 @@
+module openflow-provider-config {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:openflow:provider:config";
+    prefix "openflow-provider-config";
+
+    description
+        "Configuration for an Openflow provider.";
+
+    revision "2016-05-10" {
+        description
+            "Initial revision";
+    }
+
+    typedef non-zero-uint32-type {
+        type uint32 {
+            range "1..max";
+        }
+    }
+
+    typedef non-zero-uint16-type {
+        type uint16 {
+            range "1..max";
+        }
+    }
+
+    container openflow-provider-config {
+        leaf rpc-requests-quota {
+            type uint32;
+            default 20000;
+        }
+
+        leaf switch-features-mandatory {
+            type boolean;
+            default false;
+        }
+
+        leaf global-notification-quota {
+            type uint32;
+            default 64000;
+        }
+
+        leaf is-statistics-polling-off {
+            type boolean;
+            default "false";
+        }
+
+        leaf is-statistics-rpc-enabled {
+            description "Deprecated - exposing backward compatible statistics rpcs providing result in form of async notification";
+            type boolean;
+            default "false";
+        }
+
+        leaf barrier-interval-timeout-limit {
+            type non-zero-uint32-type;
+            default 500;
+        }
+
+        leaf barrier-count-limit {
+            type non-zero-uint16-type;
+            default 25600;
+        }
+
+        leaf echo-reply-timeout {
+            type non-zero-uint32-type;
+            default 2000;
+        }
+    }
+}
\ No newline at end of file
index fa640fe401c0a6ec34ddefee2c4f325d758d4049..cb020ef858dac66f0aeb8d732977dfe08eddc133 100644 (file)
@@ -16,5 +16,7 @@ module openflow-provider {
     identity openflow-provider{
         base config:service-type;
         config:java-class "org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider";
+        config:disable-osgi-service-registration;
+        status deprecated;
     }
 }
\ No newline at end of file
diff --git a/openflowplugin-blueprint-config/pom.xml b/openflowplugin-blueprint-config/pom.xml
new file mode 100644 (file)
index 0000000..61dd36f
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+      <groupId>org.opendaylight.openflowplugin</groupId>
+      <artifactId>openflowplugin-parent</artifactId>
+      <version>0.3.0-SNAPSHOT</version>
+      <relativePath>../parent</relativePath>
+    </parent>
+
+    <artifactId>openflowplugin-blueprint-config</artifactId>
+    <description>Blueprint configuration for the openflowplugin</description>
+    <packaging>bundle</packaging>
+
+    <build>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>maven-bundle-plugin</artifactId>
+          <extensions>true</extensions>
+          <configuration>
+            <instructions>
+              <DynamicImport-Package>*</DynamicImport-Package>
+           </instructions>
+         </configuration>
+       </plugin>
+     </plugins>
+   </build>
+</project>
diff --git a/openflowplugin-blueprint-config/src/main/resources/org/opendaylight/blueprint/openflowplugin.xml b/openflowplugin-blueprint-config/src/main/resources/org/opendaylight/blueprint/openflowplugin.xml
new file mode 100644 (file)
index 0000000..db68c3b
--- /dev/null
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+        odl:use-default-for-reference-types="true">
+
+  <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" odl:type="pingpong"/>
+  <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"/>
+  <reference id="notificationService" interface="org.opendaylight.controller.md.sal.binding.api.NotificationService"/>
+  <reference id="notificationPublishService" interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"/>
+  <reference id="entityOwnershipService" interface="org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService"/>
+
+  <reference id="switchConnProviderFactory"
+          interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderFactory"/>
+
+  <!-- Create OF switch connection provider on port 6633 -->
+  <odl:clustered-app-config id="defaultSwitchConnConfig"
+      binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfig"
+      list-key-value="openflow-switch-connection-provider-default-impl">
+    <odl:default-config><![CDATA[
+      <switch-connection-config xmlns="urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:config">
+        <instance-name>openflow-switch-connection-provider-default-impl</instance-name>
+        <port>6633</port>
+        <transport-protocol>TCP</transport-protocol>
+      </switch-connection-config>
+    ]]></odl:default-config>
+  </odl:clustered-app-config>
+
+  <bean id="defaultSwitchConnProvider" factory-ref="switchConnProviderFactory" factory-method="newInstance">
+    <argument ref="defaultSwitchConnConfig"/>
+  </bean>
+
+  <service ref="defaultSwitchConnProvider" interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider"
+          odl:type="openflow-switch-connection-provider-default-impl"/>
+
+  <!-- Create OF switch connection provider on port 6653 -->
+  <odl:clustered-app-config id="legacySwitchConnConfig"
+      binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfig"
+      list-key-value="openflow-switch-connection-provider-legacy-impl">
+    <odl:default-config><![CDATA[
+      <switch-connection-config xmlns="urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:config">
+        <instance-name>openflow-switch-connection-provider-legacy-impl</instance-name>
+        <port>6653</port>
+        <transport-protocol>TCP</transport-protocol>
+      </switch-connection-config>
+    ]]></odl:default-config>
+  </odl:clustered-app-config>
+
+  <bean id="legacySwitchConnProvider" factory-ref="switchConnProviderFactory" factory-method="newInstance">
+    <argument ref="legacySwitchConnConfig"/>
+  </bean>
+
+  <service ref="legacySwitchConnProvider" interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider"
+          odl:type="openflow-switch-connection-provider-legacy-impl"/>
+
+  <!-- Create OpenflowPluginProvider instance -->
+
+  <odl:clustered-app-config id="openflowProviderConfig"
+      binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig"/>
+
+  <reference id="openflowPluginProviderFactory"
+          interface="org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProviderFactory"/>
+
+  <bean id="openflowPluginProvider" factory-ref="openflowPluginProviderFactory" factory-method="newInstance">
+    <argument ref="openflowProviderConfig"/>
+    <argument ref="dataBroker"/>
+    <argument ref="rpcRegistry"/>
+    <argument ref="notificationService"/>
+    <argument ref="notificationPublishService"/>
+    <argument ref="entityOwnershipService"/>
+    <argument>
+      <list>
+        <ref component-id="defaultSwitchConnProvider"/>
+        <ref component-id="legacySwitchConnProvider"/>
+      </list>
+    </argument>
+  </bean>
+
+  <service ref="openflowPluginProvider" odl:type="openflow-plugin-provider-impl">
+    <interfaces>
+      <value>org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider</value>
+      <value>org.opendaylight.openflowplugin.extension.api.OpenFlowPluginExtensionRegistratorProvider</value>
+    </interfaces>
+  </service>
+
+</blueprint>
\ No newline at end of file
index 7a282c09dc0b9c53b21cdc95064bb181b91f8f20..0c9db146a83f134650d5da12538282b19ba1a98b 100644 (file)
@@ -6,6 +6,9 @@ Copyright (c) 2014 Cisco Systems, 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
+
+NOTE: This file is deprecated as wiring is now done via blueprint. This file is kept for
+       backwards compatibility. Runtime modifications are not honored.
 -->
 <snapshot>
     <required-capabilities>
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderFactoryImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderFactoryImpl.java
new file mode 100644 (file)
index 0000000..202b177
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, 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.openflowplugin.impl;
+
+import java.util.List;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
+import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
+import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider;
+import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProviderFactory;
+import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Implementation of OpenFlowPluginProviderFactory.
+ *
+ * @author Thomas Pantelis
+ */
+public class OpenFlowPluginProviderFactoryImpl implements OpenFlowPluginProviderFactory {
+    private static final Logger LOG = LoggerFactory.getLogger(OpenFlowPluginProviderFactoryImpl.class);
+
+    @Override
+    public OpenFlowPluginProvider newInstance(OpenflowProviderConfig providerConfig, DataBroker dataBroker,
+            RpcProviderRegistry rpcRegistry, NotificationService notificationService,
+            NotificationPublishService notificationPublishService,
+            EntityOwnershipService entityOwnershipService,
+            List<SwitchConnectionProvider> switchConnectionProviders) {
+
+        LOG.info("Initializing new OFP southbound.");
+
+        OpenflowPortsUtil.init();
+        OpenFlowPluginProvider openflowPluginProvider = new OpenFlowPluginProviderImpl(providerConfig.getRpcRequestsQuota(),
+                providerConfig.getGlobalNotificationQuota());
+
+        openflowPluginProvider.setSwitchConnectionProviders(switchConnectionProviders);
+        openflowPluginProvider.setDataBroker(dataBroker);
+        openflowPluginProvider.setRpcProviderRegistry(rpcRegistry);
+        openflowPluginProvider.setNotificationProviderService(notificationService);
+        openflowPluginProvider.setNotificationPublishService(notificationPublishService);
+        openflowPluginProvider.setEntityOwnershipService(entityOwnershipService);
+        openflowPluginProvider.setSwitchFeaturesMandatory(providerConfig.isSwitchFeaturesMandatory());
+        openflowPluginProvider.setIsStatisticsPollingOff(providerConfig.isIsStatisticsPollingOff());
+        openflowPluginProvider.setIsStatisticsRpcEnabled(providerConfig.isIsStatisticsRpcEnabled());
+        openflowPluginProvider.setBarrierCountLimit(providerConfig.getBarrierCountLimit().getValue());
+        openflowPluginProvider.setBarrierInterval(providerConfig.getBarrierIntervalTimeoutLimit().getValue());
+        openflowPluginProvider.setEchoReplyTimeout(providerConfig.getEchoReplyTimeout().getValue());
+
+        openflowPluginProvider.initialize();
+
+        LOG.info("Configured values, StatisticsPollingOff:{}, SwitchFeaturesMandatory:{}, BarrierCountLimit:{}, BarrierTimeoutLimit:{}, EchoReplyTimeout:{}",
+                providerConfig.isIsStatisticsPollingOff(), providerConfig.isSwitchFeaturesMandatory(),
+                providerConfig.getBarrierCountLimit().getValue(),
+                providerConfig.getBarrierIntervalTimeoutLimit().getValue(), providerConfig.getEchoReplyTimeout().getValue());
+
+        return openflowPluginProvider;
+    }
+}
index 4717561f7de4d8af3d5837bc0e87466bde33ff7c..b3096bb666b935815a69e226c16a0b59950a80ff 100644 (file)
@@ -1,14 +1,20 @@
 package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.openflow.plugin.impl.rev150327;
 
+import com.google.common.reflect.AbstractInvocationHandler;
+import com.google.common.reflect.Reflection;
+import java.lang.reflect.Method;
+import org.opendaylight.controller.config.api.osgi.WaitingServiceTracker;
 import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider;
-import org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl;
-import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.opendaylight.openflowplugin.extension.api.OpenFlowPluginExtensionRegistratorProvider;
+import org.osgi.framework.BundleContext;
 
-public class OpenFlowProviderModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.openflow.plugin.impl.rev150327.AbstractOpenFlowProviderModule {
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
+public class OpenFlowProviderModule extends AbstractOpenFlowProviderModule {
 
-    private static final Logger LOG = LoggerFactory.getLogger(OpenFlowProviderModule.class);
+    private BundleContext bundleContext;
 
     public OpenFlowProviderModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
@@ -19,37 +25,38 @@ public class OpenFlowProviderModule extends org.opendaylight.yang.gen.v1.urn.ope
     }
 
     @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
+    public AutoCloseable createInstance() {
+        // The service is provided via blueprint so wait for and return it here for backwards compatibility.
+        String typeFilter = String.format("(type=%s)", getIdentifier().getInstanceName());
+        final WaitingServiceTracker<OpenFlowPluginProvider> tracker = WaitingServiceTracker.create(
+                OpenFlowPluginProvider.class, bundleContext, typeFilter);
+        final OpenFlowPluginProvider openflowPluginProvider = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
+
+        // We don't want to call close on the actual service as its life cycle is controlled by blueprint but
+        // we do want to close the tracker so create a proxy to override close appropriately.
+        return Reflection.newProxy(OpenFlowPluginProviderProxyInterface.class, new AbstractInvocationHandler() {
+            @Override
+            protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
+                if (method.getName().equals("close")) {
+                    tracker.close();
+                    return null;
+                } else {
+                    return method.invoke(openflowPluginProvider, args);
+                }
+            }
+        });
+    }
+
+    public void setBundleContext(BundleContext bundleContext) {
+        this.bundleContext = bundleContext;
     }
 
     @Override
-    public java.lang.AutoCloseable createInstance() {
-        LOG.info("Initializing new OFP southbound.");
-        OpenflowPortsUtil.init();
-        final OpenFlowPluginProvider openflowPluginProvider = new OpenFlowPluginProviderImpl(getRpcRequestsQuota(), getGlobalNotificationQuota());
-
-        openflowPluginProvider.setSwitchConnectionProviders(getOpenflowSwitchConnectionProviderDependency());
-        openflowPluginProvider.setDataBroker(getDataBrokerDependency());
-        openflowPluginProvider.setRpcProviderRegistry(getRpcRegistryDependency());
-        openflowPluginProvider.setNotificationProviderService(getNotificationAdapterDependency());
-        openflowPluginProvider.setNotificationPublishService(getNotificationPublishAdapterDependency());
-        openflowPluginProvider.setSwitchFeaturesMandatory(getSwitchFeaturesMandatory());
-        openflowPluginProvider.setIsStatisticsPollingOff(getIsStatisticsPollingOff());
-        openflowPluginProvider.setEntityOwnershipService(getEntityOwnershipServiceDependency());
-        openflowPluginProvider.setIsStatisticsRpcEnabled(getIsStatisticsRpcEnabled());
-        openflowPluginProvider.setBarrierCountLimit(getBarrierCountLimit().getValue());
-        openflowPluginProvider.setBarrierInterval(getBarrierIntervalTimeoutLimit().getValue());
-        openflowPluginProvider.setEchoReplyTimeout(getEchoReplyTimeout().getValue());
-
-        openflowPluginProvider.initialize();
-
-        LOG.info("Configured values, StatisticsPollingOff:{}, SwitchFeaturesMandatory:{}, BarrierCountLimit:{}, BarrierTimeoutLimit:{}, EchoReplyTimeout:{}",
-                getIsStatisticsPollingOff(), getSwitchFeaturesMandatory(), getBarrierCountLimit().getValue(),
-                getBarrierIntervalTimeoutLimit().getValue(), getEchoReplyTimeout().getValue());
-
-
-        return openflowPluginProvider;
+    public boolean canReuseInstance(AbstractOpenFlowProviderModule oldModule) {
+        return true;
     }
 
+    private static interface OpenFlowPluginProviderProxyInterface extends OpenFlowPluginProvider,
+            OpenFlowPluginExtensionRegistratorProvider {
+    }
 }
index e7448330741b378ee1124bf136fb4478f046f4bf..454ba6b5a6e2ab076c0f23ba55ce62f555a5c2d7 100644 (file)
@@ -8,6 +8,29 @@
 * Do not modify this file unless it is present under src/main directory
 */
 package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.openflow.plugin.impl.rev150327;
-public class OpenFlowProviderModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.openflow.plugin.impl.rev150327.AbstractOpenFlowProviderModuleFactory {
 
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
+public class OpenFlowProviderModuleFactory extends AbstractOpenFlowProviderModuleFactory {
+    @Override
+    public OpenFlowProviderModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
+            OpenFlowProviderModule oldModule, AutoCloseable oldInstance, BundleContext bundleContext) {
+        OpenFlowProviderModule module = super.instantiateModule(instanceName, dependencyResolver, oldModule,
+                oldInstance, bundleContext);
+        module.setBundleContext(bundleContext);
+        return module;
+    }
+
+    @Override
+    public OpenFlowProviderModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
+            BundleContext bundleContext) {
+        OpenFlowProviderModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
+        module.setBundleContext(bundleContext);
+        return module;
+    }
 }
diff --git a/openflowplugin-impl/src/main/resources/org/opendaylight/blueprint/openflowplugin-impl.xml b/openflowplugin-impl/src/main/resources/org/opendaylight/blueprint/openflowplugin-impl.xml
new file mode 100644 (file)
index 0000000..20b907b
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0">
+
+  <bean id="ofPluginProviderFactory" class="org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderFactoryImpl"/>
+
+  <service ref="ofPluginProviderFactory" interface="org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProviderFactory"
+          odl:type="default"/>
+</blueprint>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 42dc3e43f614286460092942607b8e4d2fed7375..9547c0502c10ccc36d20c48361f5985d45aa51e0 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -32,6 +32,7 @@
       <module>distribution/karaf</module>
       <module>openflowplugin-controller-config</module>
       <module>openflowplugin-blueprint-config-he</module>
+      <module>openflowplugin-blueprint-config</module>
       <!--
       <module>openflowplugin-it</module>
       -->