2 * Copyright (c) 2017, 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.dom.schema.osgi.impl;
10 import java.util.List;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.concepts.ObjectRegistration;
13 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
14 import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
15 import org.osgi.framework.BundleContext;
16 import org.osgi.service.component.ComponentFactory;
19 * Update SchemaContext service in Service Registry each time new YangModuleInfo is added or removed.
21 abstract class YangModuleInfoRegistry {
22 static @NonNull YangModuleInfoRegistry create(final BundleContext ctx, final ComponentFactory contextFactory,
23 final YangParserFactory factory) {
24 return KarafFeaturesSupport.wrap(ctx, new RegularYangModuleInfoRegistry(contextFactory, factory));
27 // Invocation from scanner, we may want to ignore this in order to not process partial updates
28 abstract void scannerUpdate();
30 abstract void scannerShutdown();
32 abstract void enableScannerAndUpdate();
34 abstract void close();
36 abstract List<ObjectRegistration<YangModuleInfo>> registerInfos(List<YangModuleInfo> infos);