From 6ece0d9a4466984c4f03852336bae09a7cd1dc8d Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 6 Sep 2017 14:04:27 -0400 Subject: Fix unimplemented createInstance The createInstance() method in the provider yang-generated Module class has a default implementation that throws an UnsupportedOperationException. Replaced default implementation with correct code to create an instance of the asdcApi and dataChange provider classes. Change-Id: I1f2b199702a9094f6808ec077d6752c4c5c0c30d Issue-ID: CCSDK-77 Signed-off-by: Dan Timoney --- .../impl/rev140523/DataChangeProviderModule.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'dataChange/provider') diff --git a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java index 0655ae20a..e210613b5 100644 --- a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java +++ b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/datachange/provider/impl/rev140523/DataChangeProviderModule.java @@ -8,9 +8,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,6 +20,9 @@ */ package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523; + +import org.onap.ccsdk.sli.northbound.DataChangeProvider; + public class DataChangeProviderModule extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.provider.impl.rev140523.AbstractDataChangeProviderModule { public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); @@ -36,8 +39,17 @@ public class DataChangeProviderModule extends org.opendaylight.yang.gen.v1.org.o @Override public java.lang.AutoCloseable createInstance() { - // TODO:implement - throw new java.lang.UnsupportedOperationException(); + final DataChangeProvider provider = new DataChangeProvider(getDataBrokerDependency() + , getNotificationServiceDependency() + , getRpcRegistryDependency()); + + return new AutoCloseable() { + + @Override + public void close() throws Exception { + provider.close(); + } + }; } } -- cgit 1.2.3-korg