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;
}
Aggregations