BUG-5280: switch transaction IDs from String to TransactionIdentifier
[controller.git] / opendaylight / md-sal / samples / clustering-test-app / provider / src / main / java / org / opendaylight / controller / config / yang / config / clustering_it_provider / ClusteringItProviderModule.java
index d91d40a34dfb9efaeb0e8c6bf2817362fed4458c..926054d3256944ead1b499587d919eea990f668e 100644 (file)
@@ -9,16 +9,7 @@
 package org.opendaylight.controller.config.yang.config.clustering_it_provider;
 
 
-import org.opendaylight.controller.clustering.it.listener.PeopleCarListener;
-import org.opendaylight.controller.clustering.it.provider.PeopleProvider;
-import org.opendaylight.controller.clustering.it.provider.PurchaseCarProvider;
-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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.purchase.rev140818.CarPurchaseService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.people.rev140818.PeopleService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
 
 public class ClusteringItProviderModule extends org.opendaylight.controller.config.yang.config.clustering_it_provider.AbstractClusteringItProviderModule {
     public ClusteringItProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
@@ -35,50 +26,8 @@ public class ClusteringItProviderModule extends org.opendaylight.controller.conf
     }
 
     @Override
-    public java.lang.AutoCloseable createInstance() {
-      DataBroker dataBrokerService = getDataBrokerDependency();
-      NotificationProviderService notificationProvider = getNotificationServiceDependency();
-
-      // Add routed RPC registration for car purchase
-      final PurchaseCarProvider purchaseCar = new PurchaseCarProvider();
-      purchaseCar.setNotificationProvider(notificationProvider);
-
-      final BindingAwareBroker.RoutedRpcRegistration<CarPurchaseService> purchaseCarRpc = getRpcRegistryDependency()
-          .addRoutedRpcImplementation(CarPurchaseService.class, purchaseCar);
-
-      // Add people provider registration
-      final PeopleProvider people = new PeopleProvider();
-      people.setDataProvider(dataBrokerService);
-
-      people.setRpcRegistration(purchaseCarRpc);
-
-      final BindingAwareBroker.RpcRegistration<PeopleService> peopleRpcReg = getRpcRegistryDependency()
-          .addRpcImplementation(PeopleService.class, people);
-
-
-
-      final PeopleCarListener peopleCarListener = new PeopleCarListener();
-      peopleCarListener.setDataProvider(dataBrokerService);
-
-      final ListenerRegistration<NotificationListener> listenerReg =
-          getNotificationServiceDependency().registerNotificationListener( peopleCarListener );
-
-      // Wrap toaster as AutoCloseable and close registrations to md-sal at
-      // close()
-      final class AutoCloseableToaster implements AutoCloseable {
-
-        @Override
-        public void close() throws Exception {
-          peopleRpcReg.close();
-          purchaseCarRpc.close();
-          people.close();
-          purchaseCar.close();
-          listenerReg.close();
-        }
-      }
-
-      AutoCloseable ret = new AutoCloseableToaster();
-      return ret;
+    public AutoCloseable createInstance() {
+        // The components are created and wired via blueprint so return an empty AutoCloseable.
+        return NoopAutoCloseable.INSTANCE;
     }
-
 }