ne-location:ne-location-provider
</type>
<name>ne-location-provider</name>
-
- <data-broker>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
- <name>binding-data-broker</name>
- </data-broker>
</module>
</modules>
</data>
--- /dev/null
+/*
+ * Copyright (c) 2016 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.ne.location.provider.cfg;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.groupbasedpolicy.ne.location.provider.NeLocationProvider;
+
+public class NeLocationProviderInstance implements AutoCloseable {
+
+ private NeLocationProvider provider;
+
+ public NeLocationProviderInstance (DataBroker dataBroker) {
+ provider = new NeLocationProvider(dataBroker);
+ }
+
+ @Override
+ public void close() throws Exception {
+ provider.close();
+ }
+}
package org.opendaylight.controller.config.yang.config.ne.location.provider.cfg;
-import org.opendaylight.groupbasedpolicy.ne.location.provider.NeLocationProvider;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
public class NeLocationProviderModule extends org.opendaylight.controller.config.yang.config.ne.location.provider.cfg.AbstractNeLocationProviderModule {
public NeLocationProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
@Override
public java.lang.AutoCloseable createInstance() {
- return new NeLocationProvider(getDataBrokerDependency());
+ return NoopAutoCloseable.INSTANCE;
}
}
--- /dev/null
+<?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"
+ odl:use-default-for-reference-types="true">
+
+ <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"/>
+
+ <bean id="nelocationProvider" class="org.opendaylight.controller.config.yang.config.ne.location.provider.cfg.NeLocationProviderInstance"
+ destroy-method="close">
+ <argument ref="dataBroker"/>
+ </bean>
+</blueprint>
augment "/config:modules/config:module/config:configuration" {
case ne-location-provider {
when "/config:modules/config:module/config:type = 'ne-location-provider'";
-
- // Wires in the data-broker service
- container data-broker {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity mdsal:binding-async-data-broker;
- }
- }
- }
}
}
}