@Before public void setUp() throws Exception { handler.setStep(new StepSupport() { @Override public void execute(StepExecution stepExecution) throws JobInterruptedException { count++; stepExecutions.add(stepExecution.getStepName()); } }); handler.afterPropertiesSet(); }
partitionHandler.setStep(this.step); if (taskExecutor == null) { taskExecutor = new SyncTaskExecutor();
@Test public void testPartitionStepWithProxyHandler() throws Exception { StepParserStepFactoryBean<Object, Object> fb = new StepParserStepFactoryBean<>(); fb.setBeanName("step1"); fb.setAllowStartIfComplete(true); fb.setJobRepository(new JobRepositorySupport()); fb.setStartLimit(5); fb.setListeners(new StepListener[] { new StepExecutionListenerSupport() }); fb.setTaskExecutor(new SyncTaskExecutor()); SimplePartitioner partitioner = new SimplePartitioner(); fb.setPartitioner(partitioner); TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(new StepSupport("foo")); ProxyFactory factory = new ProxyFactory(partitionHandler); fb.setPartitionHandler((PartitionHandler) factory.getProxy()); Object step = fb.getObject(); assertTrue(step instanceof PartitionStep); Object handler = ReflectionTestUtils.getField(step, "partitionHandler"); assertTrue(handler instanceof Advised); }
partitionHandler.setStep(getStep()); if (getTaskExecutor() == null) { taskExecutor(new SyncTaskExecutor());
private void configurePartitionStep(PartitionStep ts) { Assert.state(partitioner != null, "A Partitioner must be provided for a partition step"); Assert.state(step != null, "A Step must be provided for a partition step"); configureAbstractStep(ts); if (partitionHandler != null) { ts.setPartitionHandler(partitionHandler); } else { TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler(); partitionHandler.setStep(step); if (taskExecutor == null) { taskExecutor = new SyncTaskExecutor(); } partitionHandler.setGridSize(gridSize); partitionHandler.setTaskExecutor(taskExecutor); ts.setPartitionHandler(partitionHandler); } SimpleStepExecutionSplitter splitter = new SimpleStepExecutionSplitter(jobRepository, step, partitioner); ts.setStepExecutionSplitter(splitter); }
partitionHandler.setStep(this.step); if (taskExecutor == null) { taskExecutor = new SyncTaskExecutor();
partitionHandler.setStep(this.step); if (taskExecutor == null) { taskExecutor = new SyncTaskExecutor();
partitionHandler.setStep(this.step); if (taskExecutor == null) { taskExecutor = new SyncTaskExecutor();
partitionHandler.setStep(getStep()); if (getTaskExecutor() == null) { taskExecutor(new SyncTaskExecutor());
partitionHandler.setStep(getStep()); if (getTaskExecutor() == null) { taskExecutor(new SyncTaskExecutor());
partitionHandler.setStep(getStep()); if (getTaskExecutor() == null) { taskExecutor(new SyncTaskExecutor());