<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>
+ <type xmlns:singleton="urn:opendaylight:params:xml:ns:yang:md:sal:config:impl:cluster-singleton-service">singleton:cluster-singleton-service-impl</type>
+ <name>cluster-singleton-service-impl</name>
</module>
--->
</modules>
<services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<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>
+ <type xmlns:singleton="urn:opendaylight:params:xml:ns:yang:md:sal:config:spi:cluster-singleton-service">singleton:cluster-singleton-service</type>
<instance>
- <name>dom-cluster-singleton-service</name>
- <provider>/modules/module[type='dom-cluster-singleton-service-impl'][name='dom-cluster-singleton-service-impl']</provider>
+ <name>cluster-singleton-service</name>
+ <provider>/modules/module[type='cluster-singleton-service-impl'][name='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&revision=2016-02-26</capability>
-<!--
<capability>urn:opendaylight:params:xml:ns:yang:md:sal:config:impl:cluster-singleton-service?module=cluster-singleton-service-impl&revision=2016-07-18</capability>
<capability>urn:opendaylight:params:xml:ns:yang:md:sal:config:spi:cluster-singleton-service?module=cluster-singleton-service-spi&revision=2016-07-18</capability>
--->
</required-capabilities>
</snapshot>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-singleton-common-api</artifactId>
+ <artifactId>mdsal-singleton-dom-impl</artifactId>
</dependency>
</dependencies>
--- /dev/null
+/*
+ * 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.common.api.ClusterSingletonServiceProvider;
+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 ClusterSingletonServiceProviderModule extends AbstractClusterSingletonServiceProviderModule {
+ private BundleContext bundleContext;
+
+ public ClusterSingletonServiceProviderModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver) {
+ super(identifier, dependencyResolver);
+ }
+
+ public ClusterSingletonServiceProviderModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver,
+ final ClusterSingletonServiceProviderModule oldModule, final java.lang.AutoCloseable oldInstance) {
+ super(identifier, dependencyResolver, oldModule, oldInstance);
+ }
+
+
+ @Override
+ public AutoCloseable createInstance() {
+ final WaitingServiceTracker<ClusterSingletonServiceProvider> tracker = WaitingServiceTracker
+ .create(ClusterSingletonServiceProvider.class, bundleContext);
+ final ClusterSingletonServiceProvider 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(final Object proxy, final Method method, final Object[] args)
+ throws Throwable {
+ if (method.getName().equals("close")) {
+ tracker.close();
+ return null;
+ } else {
+ return method.invoke(service, args);
+ }
+ }
+ });
+ }
+
+ void setBundleContext(final BundleContext bundleContext) {
+ this.bundleContext = bundleContext;
+ }
+
+ private static interface AutoCloseableDOMClusterSingletonServiceProvider
+ extends ClusterSingletonServiceProvider, AutoCloseable {
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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 ClusterSingletonServiceProviderModuleFactory extends AbstractClusterSingletonServiceProviderModuleFactory {
+ @Override
+ public ClusterSingletonServiceProviderModule instantiateModule(final String instanceName, final DependencyResolver dependencyResolver,
+ final ClusterSingletonServiceProviderModule oldModule, final AutoCloseable oldInstance, final BundleContext bundleContext) {
+ final ClusterSingletonServiceProviderModule module = super.instantiateModule(instanceName, dependencyResolver, oldModule,
+ oldInstance, bundleContext);
+ module.setBundleContext(bundleContext);
+ return module;
+ }
+
+ @Override
+ public ClusterSingletonServiceProviderModule instantiateModule(final String instanceName, final DependencyResolver dependencyResolver,
+ final BundleContext bundleContext) {
+ final ClusterSingletonServiceProviderModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
+ module.setBundleContext(bundleContext);
+ return module;
+ }
+}
\ No newline at end of file
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 cluster-singleton-service-impl {
+ base config:module-type;
+ config:provided-service spi:cluster-singleton-service;
+ config:java-name-prefix ClusterSingletonServiceProvider;
+ }
+
+ augment "/config:modules/config:module/config:configuration" {
+ case cluster-singleton-service-impl {
+ when "/config:modules/config:module/config:type = 'cluster-singleton-service-impl'";
+ }
+ }
}
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 cluster-singleton-service {
+ base "config:service-type";
+ config:java-class "org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider";
+ config:disable-osgi-service-registration;
+ }
}