BUG 6396 vpp-renderer project migration to blueprint 03/43703/3
authorMatej Perina <mperina@cisco.com>
Thu, 18 Aug 2016 13:23:56 +0000 (15:23 +0200)
committerMatej Perina <mperina@cisco.com>
Wed, 24 Aug 2016 12:25:03 +0000 (12:25 +0000)
Change-Id: I278450e52e98d06b5a33f525b6239bf3ce085d59
Signed-off-by: Matej Perina <mperina@cisco.com>
renderers/vpp/src/main/config/default-config.xml
renderers/vpp/src/main/java/org/opendaylight/controller/config/yang/config/vpp_provider/impl/GbpVppProviderInstance.java [new file with mode: 0644]
renderers/vpp/src/main/java/org/opendaylight/controller/config/yang/config/vpp_provider/impl/GbpVppProviderModule.java
renderers/vpp/src/main/resources/org/opendaylight/blueprint/vpp-renderer.xml [new file with mode: 0644]
renderers/vpp/src/main/yang/vpp-provider-impl.yang

index 8049bcfaa3e52b0bc6bf410dcb38d339672edb67..9b16d70b870bd6d6f91f25458be0d1fe02c0e439 100644 (file)
                     <type xmlns:vpp="urn:opendaylight:params:xml:ns:yang:controller:config:vpp-provider:impl">
                         vpp:vpp-provider-impl
                     </type>
-                    <data-broker>
-                      <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
-                      <name>binding-data-broker</name>
-                    </data-broker>
-                    <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>
-                    </broker>
                 </module>
             </modules>
         </data>
diff --git a/renderers/vpp/src/main/java/org/opendaylight/controller/config/yang/config/vpp_provider/impl/GbpVppProviderInstance.java b/renderers/vpp/src/main/java/org/opendaylight/controller/config/yang/config/vpp_provider/impl/GbpVppProviderInstance.java
new file mode 100644 (file)
index 0000000..b33484f
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2016 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
+ */
+
+package org.opendaylight.controller.config.yang.config.vpp_provider.impl;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+
+public class GbpVppProviderInstance implements AutoCloseable {
+
+    private VppRenderer renderer;
+
+    public GbpVppProviderInstance (DataBroker dataBroker, BindingAwareBroker broker) {
+        renderer = new VppRenderer(dataBroker, broker);
+    }
+    @Override
+    public void close() throws Exception {
+        renderer.close();
+    }
+
+}
index 744f116c9f814ae575d7ae1d904ddaedbcbcfb04..feb106533ce63214ad964e0ead246f6baea9deb5 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.controller.config.yang.config.vpp_provider.impl;
 
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -30,17 +31,7 @@ public class GbpVppProviderModule extends org.opendaylight.controller.config.yan
 
     @Override
     public java.lang.AutoCloseable createInstance() {
-        final VppRenderer vppRenderer = new VppRenderer(getDataBrokerDependency(), getBrokerDependency());
-
-        LOG.info("VPP Renderer instance has been created");
-
-        return new AutoCloseable() {
-
-            @Override
-            public void close() throws Exception {
-                vppRenderer.close();
-            }
-        };
+        return NoopAutoCloseable.INSTANCE;
     }
 
 }
diff --git a/renderers/vpp/src/main/resources/org/opendaylight/blueprint/vpp-renderer.xml b/renderers/vpp/src/main/resources/org/opendaylight/blueprint/vpp-renderer.xml
new file mode 100644 (file)
index 0000000..daf5e22
--- /dev/null
@@ -0,0 +1,14 @@
+<?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"/>
+    <reference id="broker" interface="org.opendaylight.controller.sal.binding.api.BindingAwareBroker"/>
+
+    <bean id="vppRenderer" class="org.opendaylight.controller.config.yang.config.vpp_provider.impl.GbpVppProviderInstance"
+        destroy-method="close">
+        <argument ref="dataBroker"/>
+        <argument ref="broker"/>
+    </bean>
+</blueprint>
\ No newline at end of file
index 4dd23ae8d8d4c549b2a5e14034b9f6a8d218846c..035302cfd40c25a54e1b93d1cfac04ecbd7e358c 100644 (file)
@@ -36,25 +36,6 @@ module vpp-provider-impl {
     augment "/config:modules/config:module/config:configuration" {
         case vpp-provider-impl {
             when "/config:modules/config:module/config:type = 'vpp-provider-impl'";
-
-            // Wires in the data-broker service
-            container data-broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity mdsal:binding-async-data-broker;
-                    }
-                }
-            }
-            // binding aware broker
-            container broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity mdsal:binding-broker-osgi-registry;
-                    }
-                }
-            }
         }
     }
 }