Comment out mdsal-signleton-service in controller 11/42311/1
authorVaclav Demcak <vdemcak@cisco.com>
Fri, 22 Jul 2016 12:11:44 +0000 (14:11 +0200)
committerVaclav Demcak <vdemcak@cisco.com>
Fri, 22 Jul 2016 12:19:12 +0000 (14:19 +0200)
We'd like to have only one (DOM) ClusterSingletonServiceProvider in ODL.
So we have to commented out all actual reference for CSS DOM API in
controller and we'll able to clean MD-SAL CSS projects for DOM API
and stay with common API only.

So this patch has to be applay before
https://git.opendaylight.org/gerrit/#/c/42294/

Change-Id: I110b4554e4713802b9c261de8b1fd793eabb012a
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/06-clustered-entity-ownership.xml.conf
opendaylight/md-sal/sal-dom-config/pom.xml
opendaylight/md-sal/sal-dom-config/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/md/sal/config/impl/cluster/singleton/service/rev160718/DOMClusterSingletonServiceProviderModule.java [deleted file]
opendaylight/md-sal/sal-dom-config/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/md/sal/config/impl/cluster/singleton/service/rev160718/DOMClusterSingletonServiceProviderModuleFactory.java [deleted file]
opendaylight/md-sal/sal-dom-config/src/main/yang/cluster-singleton-service-impl-cfg.yang
opendaylight/md-sal/sal-dom-config/src/main/yang/cluster-singleton-service-spi-cfg.yang

index f6eabc4..7f693e2 100644 (file)
                     <type xmlns:legacy-eos="urn:opendaylight:params:xml:ns:yang:controller:config:legacy-entity-ownership-service-provider">legacy-eos:legacy-entity-ownership-service-provider</type>
                     <name>legacy-entity-ownership-service-provider</name>
                 </module>
-
+<!--
                 <module>
                     <type xmlns:singleton="urn:opendaylight:params:xml:ns:yang:md:sal:config:impl:cluster-singleton-service">singleton:dom-cluster-singleton-service-impl</type>
                     <name>dom-cluster-singleton-service-impl</name>
                 </module>
+-->
             </modules>
 
             <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
@@ -30,7 +31,7 @@
                         <provider>/modules/module[type='legacy-entity-ownership-service-provider'][name='legacy-entity-ownership-service-provider']</provider>
                     </instance>
                 </service>
-
+<!--
                 <service>
                     <type xmlns:singleton="urn:opendaylight:params:xml:ns:yang:md:sal:config:spi:cluster-singleton-service">singleton:dom-cluster-singleton-service</type>
                     <instance>
                         <provider>/modules/module[type='dom-cluster-singleton-service-impl'][name='dom-cluster-singleton-service-impl']</provider>
                     </instance>
                 </service>
+-->
             </services>
+
         </data>
     </configuration>
     <required-capabilities>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:config:legacy-entity-ownership-service-provider?module=opendaylight-legacy-entity-ownership-service-provider&amp;revision=2016-02-26</capability>
+<!--
         <capability>urn:opendaylight:params:xml:ns:yang:md:sal:config:impl:cluster-singleton-service?module=cluster-singleton-service-impl&amp;revision=2016-07-18</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:md:sal:config:spi:cluster-singleton-service?module=cluster-singleton-service-spi&amp;revision=2016-07-18</capability>
+-->
     </required-capabilities>
 </snapshot>
index 653fc4b..24dd317 100644 (file)
@@ -28,7 +28,7 @@
     </dependency>
     <dependency>
       <groupId>org.opendaylight.mdsal</groupId>
-      <artifactId>mdsal-singleton-dom-api</artifactId>
+      <artifactId>mdsal-singleton-common-api</artifactId>
     </dependency>
   </dependencies>
 
diff --git a/opendaylight/md-sal/sal-dom-config/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/md/sal/config/impl/cluster/singleton/service/rev160718/DOMClusterSingletonServiceProviderModule.java b/opendaylight/md-sal/sal-dom-config/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/md/sal/config/impl/cluster/singleton/service/rev160718/DOMClusterSingletonServiceProviderModule.java
deleted file mode 100644 (file)
index 72094da..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2016 Brocade Communications 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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.md.sal.config.impl.cluster.singleton.service.rev160718;
-
-import com.google.common.reflect.AbstractInvocationHandler;
-import com.google.common.reflect.Reflection;
-import java.lang.reflect.Method;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.controller.config.api.osgi.WaitingServiceTracker;
-import org.opendaylight.mdsal.singleton.dom.api.DOMClusterSingletonServiceProvider;
-import org.osgi.framework.BundleContext;
-
-/**
- * @deprecated Replaced by blueprint wiring but remains for backwards compatibility until downstream users
- *             of the provided config system service are converted to blueprint.
- */
-@Deprecated
-public class DOMClusterSingletonServiceProviderModule extends AbstractDOMClusterSingletonServiceProviderModule {
-    private BundleContext bundleContext;
-
-    public DOMClusterSingletonServiceProviderModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public DOMClusterSingletonServiceProviderModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver,
-            DOMClusterSingletonServiceProviderModule oldModule, java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-
-    @Override
-    public AutoCloseable createInstance() {
-        final WaitingServiceTracker<DOMClusterSingletonServiceProvider> tracker =
-                WaitingServiceTracker.create(DOMClusterSingletonServiceProvider.class, bundleContext);
-        final DOMClusterSingletonServiceProvider service = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
-
-        // Create a proxy to override close to close the ServiceTracker. The actual DOMClusterSingletonServiceProvider
-        // instance will be closed via blueprint.
-        return Reflection.newProxy(AutoCloseableDOMClusterSingletonServiceProvider.class, new AbstractInvocationHandler() {
-            @Override
-            protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
-                if (method.getName().equals("close")) {
-                    tracker.close();
-                    return null;
-                } else {
-                    return method.invoke(service, args);
-                }
-            }
-        });
-
-    }
-
-    void setBundleContext(BundleContext bundleContext) {
-        this.bundleContext = bundleContext;
-    }
-
-    private static interface AutoCloseableDOMClusterSingletonServiceProvider extends DOMClusterSingletonServiceProvider, AutoCloseable {
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-dom-config/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/md/sal/config/impl/cluster/singleton/service/rev160718/DOMClusterSingletonServiceProviderModuleFactory.java b/opendaylight/md-sal/sal-dom-config/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/md/sal/config/impl/cluster/singleton/service/rev160718/DOMClusterSingletonServiceProviderModuleFactory.java
deleted file mode 100644 (file)
index 3d1f534..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2016 Brocade Communications 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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.md.sal.config.impl.cluster.singleton.service.rev160718;
-
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.osgi.framework.BundleContext;
-
-/**
- * @deprecated Replaced by blueprint wiring but remains for backwards compatibility until downstream users
- *             of the provided config system service are converted to blueprint.
- */
-@Deprecated
-public class DOMClusterSingletonServiceProviderModuleFactory extends AbstractDOMClusterSingletonServiceProviderModuleFactory {
-    @Override
-    public DOMClusterSingletonServiceProviderModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
-            DOMClusterSingletonServiceProviderModule oldModule, AutoCloseable oldInstance, BundleContext bundleContext) {
-        DOMClusterSingletonServiceProviderModule module = super.instantiateModule(instanceName, dependencyResolver, oldModule,
-                oldInstance, bundleContext);
-        module.setBundleContext(bundleContext);
-        return module;
-    }
-
-    @Override
-    public DOMClusterSingletonServiceProviderModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
-            BundleContext bundleContext) {
-        DOMClusterSingletonServiceProviderModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
-        module.setBundleContext(bundleContext);
-        return module;
-    }
-}
\ No newline at end of file
index 0084a43..20c588c 100644 (file)
@@ -12,15 +12,15 @@ module cluster-singleton-service-impl {
         description "Initial revision";
     }
 
-    identity dom-cluster-singleton-service-impl {
-        base config:module-type;
-        config:provided-service spi:dom-cluster-singleton-service;
-        config:java-name-prefix DOMClusterSingletonServiceProvider;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case dom-cluster-singleton-service-impl {
-            when "/config:modules/config:module/config:type = 'dom-cluster-singleton-service-impl'";
-        }
-    }
+//    identity dom-cluster-singleton-service-impl {
+//        base config:module-type;
+//        config:provided-service spi:dom-cluster-singleton-service;
+//        config:java-name-prefix DOMClusterSingletonServiceProvider;
+//    }
+//
+//    augment "/config:modules/config:module/config:configuration" {
+//        case dom-cluster-singleton-service-impl {
+//            when "/config:modules/config:module/config:type = 'dom-cluster-singleton-service-impl'";
+//        }
+//    }
 }
index bc5f7e5..1d92534 100644 (file)
@@ -11,9 +11,9 @@ module cluster-singleton-service-spi {
         description "Initial revision";
     }
 
-    identity dom-cluster-singleton-service {
-        base "config:service-type";
-        config:java-class "org.opendaylight.mdsal.singleton.dom.api.DOMClusterSingletonServiceProvider";
-        config:disable-osgi-service-registration;
-    }
+//    identity dom-cluster-singleton-service {
+//        base "config:service-type";
+//        config:java-class "org.opendaylight.mdsal.singleton.dom.api.DOMClusterSingletonServiceProvider";
+//        config:disable-osgi-service-registration;
+//    }
 }