Search in sources :

Example 1 with AbstractPlugin

use of com.alibaba.datax.common.plugin.AbstractPlugin in project DataX by alibaba.

the class LoadUtil method loadPluginClass.

/**
     * 反射出具体plugin实例
     *
     * @param pluginType
     * @param pluginName
     * @param pluginRunType
     * @return
     */
@SuppressWarnings("unchecked")
private static synchronized Class<? extends AbstractPlugin> loadPluginClass(PluginType pluginType, String pluginName, ContainerType pluginRunType) {
    Configuration pluginConf = getPluginConf(pluginType, pluginName);
    JarLoader jarLoader = LoadUtil.getJarLoader(pluginType, pluginName);
    try {
        return (Class<? extends AbstractPlugin>) jarLoader.loadClass(pluginConf.getString("class") + "$" + pluginRunType.value());
    } catch (Exception e) {
        throw DataXException.asDataXException(FrameworkErrorCode.RUNTIME_ERROR, e);
    }
}
Also used : Configuration(com.alibaba.datax.common.util.Configuration) AbstractPlugin(com.alibaba.datax.common.plugin.AbstractPlugin) DataXException(com.alibaba.datax.common.exception.DataXException)

Aggregations

DataXException (com.alibaba.datax.common.exception.DataXException)1 AbstractPlugin (com.alibaba.datax.common.plugin.AbstractPlugin)1 Configuration (com.alibaba.datax.common.util.Configuration)1