BUG-7706: Fix ServiceUnavailableException
[bgpcep.git] / bgp / rib-impl / src / main / resources / org / opendaylight / blueprint / bgp-rib.xml
index 6fa18b2c5a3ae3471b32da12bdd748df848c2a62..d3a78a34acb4eb781f5f883857cbbacdb3beb988 100644 (file)
@@ -7,12 +7,28 @@
   <reference id="globalWorkerGroup" interface="io.netty.channel.EventLoopGroup" odl:type="global-worker-group"/>
   <reference id="clusterSingletonServiceProvider" interface="org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider"/>
 
+  <bean id="BGPPeerRegistry" class="org.opendaylight.protocol.bgp.rib.impl.StrictBGPPeerRegistry"
+          factory-method="instance" destroy-method="close"/>
+
+  <service ref="BGPPeerRegistry" interface="org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry"
+          odl:type="default">
+    <!-- The following service properties specify the config system module and instance that correspond to
+         this OSGi service which enables the config system module to be restarted when this blueprint
+         container is restarted. -->
+    <service-properties>
+      <entry key="config-module-namespace" value="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"/>
+      <entry key="config-module-name" value="strict-bgp-peer-registry"/>
+      <entry key="config-instance-name" value="global-bgp-peer-registry"/>
+    </service-properties>
+  </service>
+
   <bean id="BGPDispatcher" class="org.opendaylight.protocol.bgp.rib.impl.BGPDispatcherImpl"  destroy-method="close">
     <argument>
       <bean factory-ref="BGPExtensionContext" factory-method="getMessageRegistry"/>
     </argument>
     <argument ref="globalBossGroup"/>
     <argument ref="globalWorkerGroup"/>
+    <argument ref="BGPPeerRegistry"/>
   </bean>
 
   <service ref="BGPDispatcher" interface="org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher">
     </service-properties>
   </service>
 
-  <bean id="BGPPeerRegistry" class="org.opendaylight.protocol.bgp.rib.impl.StrictBGPPeerRegistry"
-          factory-method="instance" destroy-method="close"/>
-
-  <service ref="BGPPeerRegistry" interface="org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry"
-          odl:type="default">
-    <!-- The following service properties specify the config system module and instance that correspond to
-         this OSGi service which enables the config system module to be restarted when this blueprint
-         container is restarted. -->
-    <service-properties>
-      <entry key="config-module-namespace" value="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl"/>
-      <entry key="config-module-name" value="strict-bgp-peer-registry"/>
-      <entry key="config-instance-name" value="global-bgp-peer-registry"/>
-    </service-properties>
-  </service>
-
   <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" odl:type="pingpong"/>
   <reference id="globalBgpExtensions" interface="org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext"/>
   <reference id="codecTreeFactory" interface="org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory"/>
@@ -70,7 +71,6 @@
 
   <bean id="bgpPeer" class="org.opendaylight.protocol.bgp.rib.impl.config.BgpPeer" scope="prototype">
     <argument ref="rpcRegistry"/>
-    <argument ref="BGPPeerRegistry"/>
   </bean>
 
   <bean id="appPeer" class="org.opendaylight.protocol.bgp.rib.impl.config.AppPeer" scope="prototype"/>