Search in sources :

Example 1 with DynamicTemplateAdapter

use of org.talend.hadoop.distribution.dynamic.adapter.DynamicTemplateAdapter in project tbd-studio-se by Talend.

the class AbstractDynamicDistribution method buildDynamicPlugin.

@Override
public IDynamicPlugin buildDynamicPlugin(IDynamicMonitor monitor, DynamicConfiguration configuration) throws Exception {
    String distribution = configuration.getDistribution();
    if (!StringUtils.equals(getDistributionName(), distribution)) {
        throw new Exception("only support to build dynamic plugin of " + getDistributionName() + " instead of " + distribution);
    }
    String version = configuration.getVersion();
    TemplateBean bestTemplateBean = getCompatibleTemplate(monitor, version);
    // normally bestTemplateBean can't be null here
    DynamicTemplateAdapter templateAdapter = new DynamicTemplateAdapter(bestTemplateBean, configuration);
    templateAdapter.adapt(monitor);
    IDynamicPlugin dynamicPlugin = templateAdapter.getDynamicPlugin();
    return dynamicPlugin;
}
Also used : IDynamicPlugin(org.talend.core.runtime.dynamic.IDynamicPlugin) TemplateBean(org.talend.hadoop.distribution.dynamic.bean.TemplateBean) DynamicTemplateAdapter(org.talend.hadoop.distribution.dynamic.adapter.DynamicTemplateAdapter)

Aggregations

IDynamicPlugin (org.talend.core.runtime.dynamic.IDynamicPlugin)1 DynamicTemplateAdapter (org.talend.hadoop.distribution.dynamic.adapter.DynamicTemplateAdapter)1 TemplateBean (org.talend.hadoop.distribution.dynamic.bean.TemplateBean)1