Tabnine Logo
PartitionStep.afterPropertiesSet
Code IndexAdd Tabnine to your IDE (free)

How to use
afterPropertiesSet
method
in
org.springframework.batch.core.partition.support.PartitionStep

Best Java code snippets using org.springframework.batch.core.partition.support.PartitionStep.afterPropertiesSet (Showing top 9 results out of 315)

origin: spring-projects/spring-batch

step.afterPropertiesSet();
origin: spring-projects/spring-batch

@Test
public void testVanillaStepExecution() throws Exception {
  step.setStepExecutionSplitter(new SimpleStepExecutionSplitter(jobRepository, true, step.getName(), new SimplePartitioner()));
  step.setPartitionHandler(new PartitionHandler() {
    @Override
    public Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution)
        throws Exception {
      Set<StepExecution> executions = stepSplitter.split(stepExecution, 2);
      for (StepExecution execution : executions) {
        execution.setStatus(BatchStatus.COMPLETED);
        execution.setExitStatus(ExitStatus.COMPLETED);
      }
      return executions;
    }
  });
  step.afterPropertiesSet();
  JobExecution jobExecution = jobRepository.createJobExecution("vanillaJob", new JobParameters());
  StepExecution stepExecution = jobExecution.createStepExecution("foo");
  jobRepository.add(stepExecution);
  step.execute(stepExecution);
  // one master and two workers
  assertEquals(3, stepExecution.getJobExecution().getStepExecutions().size());
  assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
}
origin: spring-projects/spring-batch

@Test
public void testFailedStepExecution() throws Exception {
  step.setStepExecutionSplitter(new SimpleStepExecutionSplitter(jobRepository, true, step.getName(), new SimplePartitioner()));
  step.setPartitionHandler(new PartitionHandler() {
    @Override
    public Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution)
        throws Exception {
      Set<StepExecution> executions = stepSplitter.split(stepExecution, 2);
      for (StepExecution execution : executions) {
        execution.setStatus(BatchStatus.FAILED);
        execution.setExitStatus(ExitStatus.FAILED);
      }
      return executions;
    }
  });
  step.afterPropertiesSet();
  JobExecution jobExecution = jobRepository.createJobExecution("vanillaJob", new JobParameters());
  StepExecution stepExecution = jobExecution.createStepExecution("foo");
  jobRepository.add(stepExecution);
  step.execute(stepExecution);
  // one master and two workers
  assertEquals(3, stepExecution.getJobExecution().getStepExecutions().size());
  assertEquals(BatchStatus.FAILED, stepExecution.getStatus());
}
origin: spring-projects/spring-batch

@Test
public void testStoppedStepExecution() throws Exception {
  step.setStepExecutionSplitter(new SimpleStepExecutionSplitter(jobRepository, true, step.getName(), new SimplePartitioner()));
  step.setPartitionHandler(new PartitionHandler() {
    @Override
    public Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution)
        throws Exception {
      Set<StepExecution> executions = stepSplitter.split(stepExecution, 2);
      for (StepExecution execution : executions) {
        execution.setStatus(BatchStatus.STOPPED);
        execution.setExitStatus(ExitStatus.STOPPED);
      }
      return executions;
    }
  });
  step.afterPropertiesSet();
  JobExecution jobExecution = jobRepository.createJobExecution("vanillaJob", new JobParameters());
  StepExecution stepExecution = jobExecution.createStepExecution("foo");
  jobRepository.add(stepExecution);
  step.execute(stepExecution);
  // one master and two workers
  assertEquals(3, stepExecution.getJobExecution().getStepExecutions().size());
  assertEquals(BatchStatus.STOPPED, stepExecution.getStatus());
}
origin: spring-projects/spring-batch

step.afterPropertiesSet();
JobExecution jobExecution = jobRepository.createJobExecution("vanillaJob", new JobParameters());
StepExecution stepExecution = jobExecution.createStepExecution("foo");
origin: spring-projects/spring-batch

@Test
public void testStepAggregator() throws Exception {
  step.setStepExecutionAggregator(new DefaultStepExecutionAggregator() {
    @Override
    public void aggregate(StepExecution result, Collection<StepExecution> executions) {
      super.aggregate(result, executions);
      result.getExecutionContext().put("aggregated", true);
    }
  });
  step.setStepExecutionSplitter(new SimpleStepExecutionSplitter(jobRepository, true, step.getName(), new SimplePartitioner()));
  step.setPartitionHandler(new PartitionHandler() {
    @Override
    public Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution)
        throws Exception {
      return Arrays.asList(stepExecution);
    }
  });
  step.afterPropertiesSet();
  JobExecution jobExecution = jobRepository.createJobExecution("vanillaJob", new JobParameters());
  StepExecution stepExecution = jobExecution.createStepExecution("foo");
  jobRepository.add(stepExecution);
  step.execute(stepExecution);
  assertEquals(true, stepExecution.getExecutionContext().get("aggregated"));
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

step.afterPropertiesSet();
origin: org.springframework.batch/spring-batch-core

step.afterPropertiesSet();
origin: apache/servicemix-bundles

step.afterPropertiesSet();
org.springframework.batch.core.partition.supportPartitionStepafterPropertiesSet

Javadoc

Assert that mandatory properties are set (stepExecutionSplitter, partitionHandler) and delegate top superclass.

Popular methods of PartitionStep

  • setPartitionHandler
    A PartitionHandler which can send out step executions for remote processing and bring back the resul
  • setStepExecutionSplitter
    Public setter for mandatory property StepExecutionSplitter.
  • <init>
  • setName
  • setStepExecutionAggregator
    A StepExecutionAggregator that can aggregate step executions when they come back from the handler. D
  • execute
  • getName
  • setJobRepository

Popular in Java

  • Making http post requests using okhttp
  • startActivity (Activity)
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • JFrame (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now