blob: 321aa721a54b25f8180f85508c388c0fb3c3e22b [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
Thomas Vachuska97e4d1a2017-07-31 14:25:48 -070023 * the model was registered to allow access to model-specific resources.
24 *
25 * Note: Consider promoting this to ONOS YANG Tools repo.
Thomas Vachuskac307d212017-07-31 13:57:20 -070026 */
27@Beta
28public interface YangClassLoaderRegistry {
29
30 /**
31 * Get the class loader registered for the given model id.
32 *
33 * @param modelId model identifier
34 * @return class loader registered for the model
35 */
36 ClassLoader getClassLoader(String modelId);
37
38 /**
39 * Register the class loader for the specified model.
40 *
41 * @param modelId model identifier
42 * @param classLoader class loader
43 */
44 void registerClassLoader(String modelId, ClassLoader classLoader);
45
46 /**
47 * Register the class loader for the specified model.
48 *
49 * @param modelId model identifier
50 */
51 void unregisterClassLoader(String modelId);
52}