try {
ILaunchConfiguration[] matchingConfigs =
DebugPlugin.getDefault().getLaunchManager()
.getLaunchConfigurations(launchConfigType);
ILaunchConfiguration launchConfig = null;
// TODO(jz) allow choosing correct config, for now we're always
// going to use the first
if (matchingConfigs.length == 1) {
launchConfig = matchingConfigs[0];
} else {
launchConfig =
launchConfigType
.newInstance(null, DebugPlugin.getDefault()
.getLaunchManager()
.generateUniqueLaunchConfigurationNameFrom(
"Run Hadoop Jar"));
}
ILaunchConfigurationWorkingCopy copy =
launchConfig
.copy("Run " + jar.getName() + " on " + this.getName());
// COMMENTED(jz) - perform the jarring in the launch delegate now
// copy.setAttribute("hadoop.jar",
// jar.buildJar(monitor).toString());
copy.setAttribute("hadoop.jarrable", jar.toMemento());
copy.setAttribute("hadoop.host", this.getEffectiveHostName());
copy.setAttribute("hadoop.user", this.getUserName());
copy.setAttribute("hadoop.serverid", this.id);
copy.setAttribute("hadoop.path", this.getInstallPath());
ILaunchConfiguration saved = copy.doSave();
// NOTE(jz) became deprecated in 3.3, replaced with getDelegates
// (plural) method,
// as this new method is marked experimental leaving as-is for now
ILaunchConfigurationDelegate delegate =