X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tools%2Fodl-mdsal-clustering-tests%2Fclustering-test-app%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyang%2Fconfig%2Fclustering_it_provider%2FClusteringItProviderModule.java;fp=tools%2Fodl-mdsal-clustering-tests%2Fclustering-test-app%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyang%2Fconfig%2Fclustering_it_provider%2FClusteringItProviderModule.java;h=0000000000000000000000000000000000000000;hb=0e547343bbbc98bb9c8b0307bcd48ccf0bdb49a1;hp=d91d40a34dfb9efaeb0e8c6bf2817362fed4458c;hpb=9b3c526cd3b993e24794509b68e408f41672a4f3;p=integration%2Ftest.git diff --git a/tools/odl-mdsal-clustering-tests/clustering-test-app/provider/src/main/java/org/opendaylight/controller/config/yang/config/clustering_it_provider/ClusteringItProviderModule.java b/tools/odl-mdsal-clustering-tests/clustering-test-app/provider/src/main/java/org/opendaylight/controller/config/yang/config/clustering_it_provider/ClusteringItProviderModule.java deleted file mode 100644 index d91d40a34d..0000000000 --- a/tools/odl-mdsal-clustering-tests/clustering-test-app/provider/src/main/java/org/opendaylight/controller/config/yang/config/clustering_it_provider/ClusteringItProviderModule.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 - */ - -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; - -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) { - super(identifier, dependencyResolver); - } - - public ClusteringItProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.clustering_it_provider.ClusteringItProviderModule oldModule, java.lang.AutoCloseable oldInstance) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - public void customValidation() { - // add custom validation form module attributes here. - } - - @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 purchaseCarRpc = getRpcRegistryDependency() - .addRoutedRpcImplementation(CarPurchaseService.class, purchaseCar); - - // Add people provider registration - final PeopleProvider people = new PeopleProvider(); - people.setDataProvider(dataBrokerService); - - people.setRpcRegistration(purchaseCarRpc); - - final BindingAwareBroker.RpcRegistration peopleRpcReg = getRpcRegistryDependency() - .addRpcImplementation(PeopleService.class, people); - - - - final PeopleCarListener peopleCarListener = new PeopleCarListener(); - peopleCarListener.setDataProvider(dataBrokerService); - - final ListenerRegistration 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; - } - -}