blob: 719834644d94a730b1564639858c7833cc9e70d5 [file] [log] [blame]
Thomas Vachuskac307d212017-07-31 13:57:20 -07001/*
2 * Copyright 2017-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yang;
18
19import com.google.common.annotations.Beta;
20
21/**
22 * Auxiliary mechanism for resolving model IDs into class-loaders from where
23 * the model was registered.
24 */
25@Beta
26public interface YangClassLoaderRegistry {
27
28 /**
29 * Get the class loader registered for the given model id.
30 *
31 * @param modelId model identifier
32 * @return class loader registered for the model
33 */
34 ClassLoader getClassLoader(String modelId);
35
36 /**
37 * Register the class loader for the specified model.
38 *
39 * @param modelId model identifier
40 * @param classLoader class loader
41 */
42 void registerClassLoader(String modelId, ClassLoader classLoader);
43
44 /**
45 * Register the class loader for the specified model.
46 *
47 * @param modelId model identifier
48 */
49 void unregisterClassLoader(String modelId);
50}