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/AsdcApiProviderModule.java | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'asdcApi/provider') diff --git a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java index ddf8093fb..26dc94285 100644 --- a/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.java +++ b/asdcApi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/northbound/asdcapi/provider/impl/rev140523/AsdcApiProviderModule.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.asdcapi.provider.impl.rev140523; + +import org.onap.ccsdk.sli.northbound.asdcapi.AsdcApiProvider; + public class AsdcApiProviderModule extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.provider.impl.rev140523.AbstractAsdcApiProviderModule { public AsdcApiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); @@ -36,8 +39,21 @@ public class AsdcApiProviderModule extends org.opendaylight.yang.gen.v1.org.onap @Override public java.lang.AutoCloseable createInstance() { - // TODO:implement - throw new java.lang.UnsupportedOperationException(); + + + final AsdcApiProvider provider = new AsdcApiProvider(getDataBrokerDependency() + , getNotificationServiceDependency() + , getRpcRegistryDependency()); + + return new AutoCloseable() { + + @Override + public void close() throws Exception { + + provider.close(); + } + }; + } } -- cgit 1.2.3-korg