/** * Check if a step execution is startable. * @param stepExecution the step execution to check * @param context the execution context of the step * @return true if the step execution is startable, false otherwise * @throws JobExecutionException if unable to check if the step execution is startable */ protected boolean isStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException { return getStartable(stepExecution, context); }
/** * Check if a step execution is startable. * @param stepExecution the step execution to check * @param context the execution context of the step * @return true if the step execution is startable, false otherwise * @throws JobExecutionException if unable to check if the step execution is startable */ protected boolean isStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException { return getStartable(stepExecution, context); }
/** * Check if a step execution is startable. * @param stepExecution the step execution to check * @param context the execution context of the step * @return true if the step execution is startable, false otherwise * @throws JobExecutionException if unable to check if the step execution is startable */ protected boolean isStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException { return getStartable(stepExecution, context); }
/** * @see StepExecutionSplitter#split(StepExecution, int) */ public Set<StepExecution> split(StepExecution stepExecution, int gridSize) throws JobExecutionException { JobExecution jobExecution = stepExecution.getJobExecution(); Map<String, ExecutionContext> contexts = getContexts(stepExecution, gridSize); Set<StepExecution> set = new HashSet<StepExecution>(contexts.size()); for (Entry<String, ExecutionContext> context : contexts.entrySet()) { // Make the step execution name unique and repeatable String stepName = this.stepName + STEP_NAME_SEPARATOR + context.getKey(); StepExecution currentStepExecution = jobExecution.createStepExecution(stepName); boolean startable = getStartable(currentStepExecution, context.getValue()); if (startable) { jobRepository.add(currentStepExecution); set.add(currentStepExecution); } } return set; }
/** * @see StepExecutionSplitter#split(StepExecution, int) */ @Override public Set<StepExecution> split(StepExecution stepExecution, int gridSize) throws JobExecutionException { JobExecution jobExecution = stepExecution.getJobExecution(); Map<String, ExecutionContext> contexts = getContexts(stepExecution, gridSize); Set<StepExecution> set = new HashSet<StepExecution>(contexts.size()); for (Entry<String, ExecutionContext> context : contexts.entrySet()) { // Make the step execution name unique and repeatable String stepName = this.stepName + STEP_NAME_SEPARATOR + context.getKey(); StepExecution currentStepExecution = jobExecution.createStepExecution(stepName); boolean startable = getStartable(currentStepExecution, context.getValue()); if (startable) { set.add(currentStepExecution); } } jobRepository.addAll(set); return set; }