Bug 1459-3 #1 - Re-organize mdsal-binding2-spec
[mdsal.git] / binding2 / mdsal-binding2-generator-api / src / main / java / org / opendaylight / mdsal / binding2 / generator / api / ClassLoadingStrategy.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. 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
9 package org.opendaylight.mdsal.binding2.generator.api;
10
11 import com.google.common.annotations.Beta;
12 import org.opendaylight.mdsal.binding2.model.api.Type;
13
14 /**
15  *
16  * Part of the Binding runtime context that dynamically loads Java classes into the Java
17  * Virtual Machine. Usually classes are only loaded on demand.
18  *
19  */
20 @Beta
21 public interface ClassLoadingStrategy {
22
23     /**
24      *
25      * @param type Generated Type
26      * @return instance of class
27      * @throws ClassNotFoundException
28      */
29     Class<?> loadClass(Type type) throws ClassNotFoundException;
30
31     /**
32      *
33      * @param fqcn fully qualified Java class name
34      * @return instance of class
35      * @throws ClassNotFoundException
36      */
37     Class<?> loadClass(String fqcn) throws ClassNotFoundException;
38 }