congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

    • Parsing JSON documents to java classes using gson
    • setContentView (Activity)
    • startActivity (Activity)
    • getSupportFragmentManager (FragmentActivity)
    • Pointer (com.sun.jna)
      An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
    • Color (java.awt)
      The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
    • Map (java.util)
      A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
    • Callable (java.util.concurrent)
      A task that returns a result and may throw an exception. Implementors define a single method with no
    • Executors (java.util.concurrent)
      Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
    • Pattern (java.util.regex)
      Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
    • From CI to AI: The AI layer in your organization
    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