Search in sources :

Example 1 with ClassLoaderBean

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

the class DynamicClassLoaderExtensionAdaper method adapt.

public IDynamicExtension adapt(IDynamicMonitor monitor) throws Exception {
    DynamicDistributionUtils.checkCancelOrNot(monitor);
    resolve();
    TemplateBean templateBean = getTemplateBean();
    DynamicConfiguration configuration = getConfiguration();
    String id = configuration.getId();
    String distributionName = templateBean.getDistribution();
    String templateId = templateBean.getId();
    IDynamicExtension classLoaderExtension = DynamicFactory.getInstance().createDynamicExtension();
    classLoaderExtension.setExtensionId(DynamicDistributionUtils.getExtensionId(DynamicDistributionUtils.getPluginKey(distributionName, templateId, id, ATTR_POINT)));
    classLoaderExtension.setExtensionPoint(ATTR_POINT);
    List<ClassLoaderBean> classLoaders = templateBean.getClassLoaders();
    if (classLoaders != null) {
        for (ClassLoaderBean classLoader : classLoaders) {
            DynamicDistributionUtils.checkCancelOrNot(monitor);
            DynamicClassloaderAdapter classLoaderAdapter = new DynamicClassloaderAdapter(templateBean, configuration, classLoader, moduleGroupBeanAdapterMap);
            IDynamicConfiguration dynamicClassLoader = classLoaderAdapter.adapt(monitor);
            classLoaderExtension.addConfiguration(dynamicClassLoader);
        }
    }
    return classLoaderExtension;
}
Also used : IDynamicConfiguration(org.talend.core.runtime.dynamic.IDynamicConfiguration) IDynamicConfiguration(org.talend.core.runtime.dynamic.IDynamicConfiguration) DynamicConfiguration(org.talend.hadoop.distribution.dynamic.DynamicConfiguration) IDynamicExtension(org.talend.core.runtime.dynamic.IDynamicExtension) TemplateBean(org.talend.hadoop.distribution.dynamic.bean.TemplateBean) ClassLoaderBean(org.talend.hadoop.distribution.dynamic.bean.ClassLoaderBean)

Aggregations

IDynamicConfiguration (org.talend.core.runtime.dynamic.IDynamicConfiguration)1 IDynamicExtension (org.talend.core.runtime.dynamic.IDynamicExtension)1 DynamicConfiguration (org.talend.hadoop.distribution.dynamic.DynamicConfiguration)1 ClassLoaderBean (org.talend.hadoop.distribution.dynamic.bean.ClassLoaderBean)1 TemplateBean (org.talend.hadoop.distribution.dynamic.bean.TemplateBean)1