use of org.ow2.proactive.scheduler.common.job.factories.spi.JobValidatorService in project scheduling by ow2-proactive.
the class StaxJobFactory method validate.
/*
* Validate the given job descriptor
*/
private File validate(File file) throws VerifierConfigurationException, JobCreationException {
Map<String, JobValidatorService> factories;
try {
factories = JobValidatorRegistry.getInstance().getRegisteredFactories();
} catch (Exception e) {
logger.error(MSG_UNABLE_TO_INSTANCIATE_JOB_VALIDATION_FACTORIES, e);
throw new VerifierConfigurationException(MSG_UNABLE_TO_INSTANCIATE_JOB_VALIDATION_FACTORIES, e);
}
File updatedFile = file;
try {
for (JobValidatorService factory : factories.values()) {
updatedFile = factory.validateJob(updatedFile);
}
} catch (JobValidationException e) {
throw e;
} catch (Exception e) {
throw new JobValidationException(true, e);
}
return updatedFile;
}
use of org.ow2.proactive.scheduler.common.job.factories.spi.JobValidatorService in project scheduling by ow2-proactive.
the class StaxJobFactory method validate.
/*
* Validate the given job descriptor
*/
private TaskFlowJob validate(TaskFlowJob job) throws VerifierConfigurationException, JobCreationException {
Map<String, JobValidatorService> factories;
try {
factories = JobValidatorRegistry.getInstance().getRegisteredFactories();
} catch (Exception e) {
throw new VerifierConfigurationException(MSG_UNABLE_TO_INSTANCIATE_JOB_VALIDATION_FACTORIES, e);
}
TaskFlowJob updatedJob = job;
try {
for (JobValidatorService factory : factories.values()) {
updatedJob = factory.validateJob(updatedJob);
}
} catch (JobValidationException e) {
throw e;
} catch (Exception e) {
throw new JobValidationException(e);
}
return updatedJob;
}
use of org.ow2.proactive.scheduler.common.job.factories.spi.JobValidatorService in project scheduling by ow2-proactive.
the class StaxJobFactory method validate.
/*
* Validate the given job descriptor
*/
private TaskFlowJob validate(TaskFlowJob job, Scheduler scheduler, SchedulerSpaceInterface space, String sessionId) throws JobCreationException {
Map<String, JobValidatorService> factories;
try {
factories = JobValidatorRegistry.getInstance().getRegisteredFactories();
} catch (Exception e) {
throw new JobCreationException(MSG_UNABLE_TO_INSTANCIATE_JOB_VALIDATION_FACTORIES, e);
}
TaskFlowJob updatedJob = job;
try {
for (JobValidatorService factory : factories.values()) {
updatedJob = factory.validateJob(updatedJob, scheduler, space, sessionId);
}
} catch (JobValidationException e) {
fillUpdatedVariables(e, job);
throw e;
} catch (Exception e) {
JobValidationException validationException = new JobValidationException(e);
fillUpdatedVariables(validationException, job);
throw validationException;
}
return updatedJob;
}
Aggregations