Package org.springframework.batch.core.jsr.partition

Examples of org.springframework.batch.core.jsr.partition.JsrPartitionHandler


  /* (non-Javadoc)
   * @see org.springframework.batch.core.step.StepLocator#getStep(java.lang.String)
   */
  @Override
  public Step getStep(String stepName) throws NoSuchStepException {
    JsrPartitionHandler partitionHandler =  (JsrPartitionHandler) getPartitionHandler();
    Collection<String> names = partitionHandler.getPartitionStepNames();

    if(names.contains(stepName)) {
      return partitionHandler.getStep();
    } else {
      throw new NoSuchStepException(stepName + " was not found");
    }
  }
View Full Code Here


  public void testGetPartitionedStep() throws Exception {
    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    PartitionStep step = new PartitionStep();
    step.setName("step1");
    JsrPartitionHandler partitionHandler = new JsrPartitionHandler();
    partitionHandler.setPropertyContext(new BatchPropertyContext());
    partitionHandler.setPartitions(3);
    partitionHandler.setJobRepository(jobRepository);
    partitionHandler.setStep(new StubStep("subStep"));
    partitionHandler.afterPropertiesSet();
    step.setPartitionHandler(partitionHandler);
    step.setStepExecutionSplitter(new JsrStepExecutionSplitter(jobRepository, false, "step1", true));
    step.setJobRepository(jobRepository);
    step.afterPropertiesSet();
    transitions.add(StateTransition.createStateTransition(new StepState("job.step", step), "end0"));
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.jsr.partition.JsrPartitionHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.