congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SystemProcessExitCodeMapper.getExitStatus
Code IndexAdd Tabnine to your IDE (free)

How to use
getExitStatus
method
in
org.springframework.batch.core.step.tasklet.SystemProcessExitCodeMapper

Best Java code snippets using org.springframework.batch.core.step.tasklet.SystemProcessExitCodeMapper.getExitStatus (Showing top 6 results out of 315)

origin: spring-projects/spring-batch

contribution.setExitStatus(systemProcessExitCodeMapper.getExitStatus(systemCommandTask.get()));
return RepeatStatus.FINISHED;
origin: org.springframework.data/spring-data-hadoop-batch

@Override
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
  int exitCode = runCode();
  if(systemProcessExitCodeMapper.getExitStatus(exitCode) == ExitStatus.FAILED)
    throw new IOException("Hadoop tool failed with exit code: "+exitCode);
  return RepeatStatus.FINISHED;
}
origin: org.springframework.batch/org.springframework.batch.core

/**
 * Execute system command and map its exit code to {@link ExitStatus} using
 * {@link SystemProcessExitCodeMapper}.
 */
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
  FutureTask<Integer> systemCommandTask = new FutureTask<Integer>(new Callable<Integer>() {
    public Integer call() throws Exception {
      Process process = Runtime.getRuntime().exec(command, environmentParams, workingDirectory);
      return process.waitFor();
    }
  });
  long t0 = System.currentTimeMillis();
  taskExecutor.execute(systemCommandTask);
  while (true) {
    Thread.sleep(checkInterval);
    if (systemCommandTask.isDone()) {
      contribution.setExitStatus(systemProcessExitCodeMapper.getExitStatus(systemCommandTask.get()));
      return RepeatStatus.FINISHED;
    }
    else if (System.currentTimeMillis() - t0 > timeout) {
      systemCommandTask.cancel(interruptOnCancel);
      throw new SystemCommandException("Execution of system command did not finish within the timeout");
    }
    else if (execution.isTerminateOnly()) {
      systemCommandTask.cancel(interruptOnCancel);
      throw new JobInterruptedException("Job interrupted while executing system command '" + command + "'");
    }
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

contribution.setExitStatus(systemProcessExitCodeMapper.getExitStatus(systemCommandTask.get()));
return RepeatStatus.FINISHED;
origin: apache/servicemix-bundles

contribution.setExitStatus(systemProcessExitCodeMapper.getExitStatus(systemCommandTask.get()));
return RepeatStatus.FINISHED;
origin: org.springframework.batch/spring-batch-core

contribution.setExitStatus(systemProcessExitCodeMapper.getExitStatus(systemCommandTask.get()));
return RepeatStatus.FINISHED;
org.springframework.batch.core.step.taskletSystemProcessExitCodeMappergetExitStatus

Popular methods of SystemProcessExitCodeMapper

    Popular in Java

    • Start an intent from android
    • getSystemService (Context)
    • notifyDataSetChanged (ArrayAdapter)
    • findViewById (Activity)
    • GridLayout (java.awt)
      The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
    • OutputStream (java.io)
      A writable sink for bytes.Most clients will use output streams that write data to the file system (
    • Runnable (java.lang)
      Represents a command that can be executed. Often used to run code in a different Thread.
    • Callable (java.util.concurrent)
      A task that returns a result and may throw an exception. Implementors define a single method with no
    • JPanel (javax.swing)
    • JTable (javax.swing)
    • 14 Best Plugins for Eclipse
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

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