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.Registration;
13 import org.opendaylight.yangtools.yang.binding.YangFeatureProvider;
14 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
15 import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
16 import org.osgi.framework.BundleContext;
17 import org.osgi.service.component.ComponentFactory;
20 * Update EffectiveModelContext service in Service Registry each time new YangModuleInfo is added or removed.
22 abstract class YangModuleInfoRegistry {
23 static @NonNull YangModuleInfoRegistry create(final BundleContext ctx,
24 final ComponentFactory<OSGiModuleInfoSnapshotImpl> contextFactory, final YangParserFactory factory) {
25 return KarafFeaturesSupport.wrap(ctx, new RegularYangModuleInfoRegistry(contextFactory, factory));
28 // Invocation from scanner, we may want to ignore this in order to not process partial updates
29 abstract void scannerUpdate();
31 abstract void scannerShutdown();
33 abstract void enableScannerAndUpdate();
35 abstract void close();
37 abstract @NonNull Registration registerBundle(List<YangModuleInfo> moduleInfos,
38 List<YangFeatureProvider<?>> featureProviders);