Add blueprint wiring to sal-dom-broker 51/35851/23
authorTom Pantelis <tpanteli@brocade.com>
Sun, 6 Mar 2016 02:49:44 +0000 (21:49 -0500)
committerAnil Vishnoi <vishnoianil@gmail.com>
Tue, 12 Apr 2016 00:22:50 +0000 (00:22 +0000)
Change-Id: I48959c4ebf02881dfb29d051b35c45de3effc650
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-dom-broker-config/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomBrokerImplModule.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMRpcRouter.java
opendaylight/md-sal/sal-dom-broker/src/main/resources/org/opendaylight/blueprint/dom-broker.xml [new file with mode: 0644]

index fbae80b..61385de 100644 (file)
@@ -59,8 +59,7 @@ public final class DomBrokerImplModule extends org.opendaylight.controller.confi
 
         services.putInstance(DOMDataBroker.class, asyncBroker);
 
-        final DOMRpcRouter rpcRouter = new DOMRpcRouter();
-        schemaService.registerSchemaContextListener(rpcRouter);
+        final DOMRpcRouter rpcRouter = DOMRpcRouter.newInstance(schemaService);
         services.putInstance(DOMRpcService.class, rpcRouter);
         services.putInstance(DOMRpcProviderService.class, rpcRouter);
 
index 14e75e2..60e4db5 100644 (file)
@@ -33,6 +33,7 @@ import org.opendaylight.controller.md.sal.dom.api.DOMRpcProviderService;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
 import org.opendaylight.controller.md.sal.dom.spi.AbstractDOMRpcImplementationRegistration;
+import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -48,6 +49,12 @@ public final class DOMRpcRouter implements AutoCloseable, DOMRpcService, DOMRpcP
     private Collection<ListenerRegistration<? extends DOMRpcAvailabilityListener>> listeners = Collections.emptyList();
     private volatile DOMRpcRoutingTable routingTable = DOMRpcRoutingTable.EMPTY;
 
+    public static DOMRpcRouter newInstance(SchemaService schemaService) {
+        final DOMRpcRouter rpcRouter = new DOMRpcRouter();
+        schemaService.registerSchemaContextListener(rpcRouter);
+        return rpcRouter;
+    }
+
     @Override
     public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(final T implementation, final DOMRpcIdentifier... rpcs) {
         return registerRpcImplementation(implementation, ImmutableSet.copyOf(rpcs));
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/resources/org/opendaylight/blueprint/dom-broker.xml b/opendaylight/md-sal/sal-dom-broker/src/main/resources/org/opendaylight/blueprint/dom-broker.xml
new file mode 100644 (file)
index 0000000..b7d4d5d
--- /dev/null
@@ -0,0 +1,78 @@
+<?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"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+    odl:restart-dependents-on-updates="true">
+
+  <cm:property-placeholder persistent-id="org.opendaylight.mdsal.dom.notification" update-strategy="none">
+    <cm:default-properties>
+      <cm:property name="notification-queue-depth" value="65536"/>
+      <cm:property name="notification-queue-spin" value="0"/>
+      <cm:property name="notification-queue-park" value="0"/>
+    </cm:default-properties>
+  </cm:property-placeholder>
+
+  <!-- Schema Service -->
+
+  <bean id="schemaServiceImpl" class="org.opendaylight.controller.sal.dom.broker.GlobalBundleScanningSchemaServiceImpl"
+          factory-method="getInstance" />
+
+  <service ref="schemaServiceImpl">
+    <interfaces>
+      <value>org.opendaylight.controller.sal.core.api.model.SchemaService</value>
+      <value>org.opendaylight.controller.sal.core.api.model.YangTextSourceProvider</value>
+    </interfaces>
+  </service>
+
+  <!-- DOM Notification Service -->
+
+  <bean id="domNotificationRouter" class="org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter"
+          factory-method="create">
+    <argument value="${notification-queue-depth}"/>
+    <argument value="${notification-queue-spin}"/>
+    <argument value="${notification-queue-park}"/>
+    <argument value="MILLISECONDS"/>
+  </bean>
+
+  <service ref="domNotificationRouter" odl:type="default">
+    <interfaces>
+      <value>org.opendaylight.controller.md.sal.dom.api.DOMNotificationService</value>
+      <value>org.opendaylight.controller.md.sal.dom.api.DOMNotificationPublishService</value>
+      <value>org.opendaylight.controller.md.sal.dom.spi.DOMNotificationSubscriptionListenerRegistry</value>
+    </interfaces>
+  </service>
+
+  <!-- DOM RPC Service -->
+
+  <bean id="domRpcRouter" class="org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRouter"
+          factory-method="newInstance">
+    <argument ref="schemaServiceImpl"/>
+  </bean>
+
+  <service ref="domRpcRouter" odl:type="default">
+    <interfaces>
+      <value>org.opendaylight.controller.md.sal.dom.api.DOMRpcService</value>
+      <value>org.opendaylight.controller.md.sal.dom.api.DOMRpcProviderService</value>
+    </interfaces>
+  </service>
+
+  <!-- DOM MountPoint Service -->
+
+  <bean id="domMountPointService" class="org.opendaylight.controller.md.sal.dom.broker.impl.mount.DOMMountPointServiceImpl"/>
+
+  <service ref="domMountPointService" interface="org.opendaylight.controller.md.sal.dom.api.DOMMountPointService"
+        odl:type="default"/>
+
+  <!-- DOM PingPong Data Broker -->
+
+  <reference id="domDefaultDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker"
+      odl:type="default"/>
+
+  <bean id="domPingPongDataBroker" class="org.opendaylight.controller.md.sal.dom.broker.impl.PingPongDataBroker">
+    <argument ref="domDefaultDataBroker"/>
+  </bean>
+
+  <service ref="domPingPongDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker"
+      odl:type="pingpong"/>
+
+</blueprint>

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.