LOG.warn(msg);
throw new DatasetModuleConflictException(msg);
}
ClassLoader cl;
DatasetModule module;
File unpackedLocation = Files.createTempDir();
DependencyTrackingRegistry reg;
try {
// NOTE: if jarLocation is null, we assume that this is a system module, ie. always present in classpath
if (jarLocation != null) {
BundleJarUtil.unpackProgramJar(jarLocation, unpackedLocation);
}
cl = jarLocation == null ? this.getClass().getClassLoader() :
ClassLoaders.newProgramClassLoader(unpackedLocation, ApiResourceListHolder.getResourceList(),
this.getClass().getClassLoader());
@SuppressWarnings("unchecked")
Class clazz = ClassLoaders.loadClass(className, cl, this);
module = DatasetModules.getDatasetModule(clazz);
reg = new DependencyTrackingRegistry(datasets);
module.register(reg);
} catch (Exception e) {
LOG.error("Could not instantiate instance of dataset module class {} for module {} using jarLocation {}",
className, name, jarLocation);
throw Throwables.propagate(e);
} finally {