/*
 * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * WSO2 Inc. licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.wso2.carbon.uuf.internal.deployment;


import org.wso2.carbon.uuf.exception.PluginLoadingException;

/**
 * A provider that gives instances of plugins for an uuf app.
 *
 * @since 1.0.0
 */
public interface PluginProvider {

    /**
     * Returns an instance of the specified plugin by loading the plugin class through the specified class loader.
     *
     * @param type        plugin type class
     * @param className   plugin class name
     * @param classLoader class loader to be used to load the plugin class
     * @param <T>         plugin type
     * @return instance of the plugin
     * @throws PluginLoadingException if en error occurred when loading or instantiation of the plugin
     */
    <T> T getPluginInstance(Class<T> type, String className, ClassLoader classLoader) throws PluginLoadingException;
}

add PluginProvider interface