catch (Exception ex) {
throw new RuntimeException("Could not instantiate chained task driver.", ex);
}
// get the configuration for the task
final TaskConfig chainedStubConf = config.getChainedStubConfig(i);
final String taskName = config.getChainedTaskName(i);
if (i == numChained -1) {
// last in chain, instantiate the output collector for this task
previous = getOutputCollector(nepheleTask, chainedStubConf, cl, eventualOutputs, chainedStubConf.getNumOutputs());
}
ct.setup(chainedStubConf, taskName, previous, nepheleTask, cl);
chainedTasksTarget.add(0, ct);