faas:faas-provider-impl
</type>
<name>faas-provider-impl</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>
-
- <ep-renderer-augmentation-registry>
- <type xmlns:epr="urn:opendaylight:params:xml:ns:yang:controller:config:groupbasedpolicy">epr:ep-renderer-augmentation-registry</type>
- <name>ep-renderer-augmentation-registry</name>
- </ep-renderer-augmentation-registry>
-
</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.faas_provider.impl;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.groupbasedpolicy.api.EpRendererAugmentationRegistry;
+import org.opendaylight.groupbasedpolicy.renderer.faas.FaasRenderer;
+
+public class FaasProviderInstance implements AutoCloseable{
+
+ private FaasRenderer renderer;
+
+ public FaasProviderInstance (DataBroker dataBroker, EpRendererAugmentationRegistry epRegistry) {
+ renderer = new FaasRenderer(dataBroker, epRegistry);
+ }
+
+ @Override
+ public void close() throws Exception {
+ renderer.close();
+ }
+
+}
/*
* Copyright (c) 2015 Huawei Technologies 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.faas_provider.impl;
-import org.opendaylight.groupbasedpolicy.renderer.faas.FaasRenderer;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
public class FaasProviderModule extends
org.opendaylight.controller.config.yang.config.faas_provider.impl.AbstractFaasProviderModule {
@Override
public java.lang.AutoCloseable createInstance() {
- return new FaasRenderer(getDataBrokerDependency(), getEpRendererAugmentationRegistryDependency());
+ 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"/>
+ <reference id="epRegistry" interface="org.opendaylight.groupbasedpolicy.api.EpRendererAugmentationRegistry"/>
+
+ <bean id="faasRenderer" class="org.opendaylight.controller.config.yang.config.faas_provider.impl.FaasProviderInstance"
+ destroy-method="close">
+ <argument ref="dataBroker"/>
+ <argument ref="epRegistry"/>
+ </bean>
+</blueprint>
\ No newline at end of file
augment "/config:modules/config:module/config:configuration" {
case faas-provider-impl {
when "/config:modules/config:module/config:type = 'faas-provider-impl'";
-
- //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;
- }
- }
- }
- // EpRendererAugmentationRegistry service
- container ep-renderer-augmentation-registry {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity gbpcfg:ep-renderer-augmentation-registry;
- }
- }
- }
}
}
}