Fix raw Component{Factory,Instance} references
[mdsal.git] / dom / mdsal-dom-schema-osgi / src / main / java / org / opendaylight / mdsal / dom / schema / osgi / impl / YangModuleInfoRegistry.java
1 /*
2  * Copyright (c) 2017, 2020 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.mdsal.dom.schema.osgi.impl;
9
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;
17
18 /**
19  * Update SchemaContext service in Service Registry each time new YangModuleInfo is added or removed.
20  */
21 abstract class YangModuleInfoRegistry {
22     static @NonNull YangModuleInfoRegistry create(final BundleContext ctx,
23             final ComponentFactory<OSGiModuleInfoSnapshotImpl> contextFactory, final YangParserFactory factory) {
24         return KarafFeaturesSupport.wrap(ctx, new RegularYangModuleInfoRegistry(contextFactory, factory));
25     }
26
27     // Invocation from scanner, we may want to ignore this in order to not process partial updates
28     abstract void scannerUpdate();
29
30     abstract void scannerShutdown();
31
32     abstract void enableScannerAndUpdate();
33
34     abstract void close();
35
36     abstract List<ObjectRegistration<YangModuleInfo>> registerInfos(List<YangModuleInfo> infos);
37 }