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

How to use
JobInstanceAlreadyExistsException
in
org.springframework.batch.core.launch

Best Java code snippets using org.springframework.batch.core.launch.JobInstanceAlreadyExistsException (Showing top 7 results out of 315)

origin: spring-projects/spring-batch

@Override
public Exception getException(String msg, Throwable t) throws Exception {
  return new JobInstanceAlreadyExistsException(msg, t);
}
origin: spring-projects/spring-batch

@Override
public Exception getException(String msg) throws Exception {
  return new JobInstanceAlreadyExistsException(msg);
}
origin: spring-projects/spring-batch

@Override
public Long start(String jobName, String parameters) throws NoSuchJobException, JobInstanceAlreadyExistsException, JobParametersInvalidException {
  logger.info("Checking status of job with name=" + jobName);
  JobParameters jobParameters = jobParametersConverter.getJobParameters(PropertiesConverter
      .stringToProperties(parameters));
  if (jobRepository.isJobInstanceExists(jobName, jobParameters)) {
    throw new JobInstanceAlreadyExistsException(String.format(
        "Cannot start a job instance that already exists with name=%s and parameters=%s", jobName,
        parameters));
  }
  Job job = jobRegistry.getJob(jobName);
  logger.info(String.format("Attempting to launch job with name=%s and parameters=%s", jobName, parameters));
  try {
    return jobLauncher.run(job, jobParameters).getId();
  }
  catch (JobExecutionAlreadyRunningException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job execution already running",
        jobName, parameters), e);
  }
  catch (JobRestartException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job not restartable", jobName,
        parameters), e);
  }
  catch (JobInstanceAlreadyCompleteException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job already complete", jobName,
        parameters), e);
  }
}
origin: org.springframework.batch/spring-batch-core

@Override
public Long start(String jobName, String parameters) throws NoSuchJobException, JobInstanceAlreadyExistsException, JobParametersInvalidException {
  logger.info("Checking status of job with name=" + jobName);
  JobParameters jobParameters = jobParametersConverter.getJobParameters(PropertiesConverter
      .stringToProperties(parameters));
  if (jobRepository.isJobInstanceExists(jobName, jobParameters)) {
    throw new JobInstanceAlreadyExistsException(String.format(
        "Cannot start a job instance that already exists with name=%s and parameters=%s", jobName,
        parameters));
  }
  Job job = jobRegistry.getJob(jobName);
  logger.info(String.format("Attempting to launch job with name=%s and parameters=%s", jobName, parameters));
  try {
    return jobLauncher.run(job, jobParameters).getId();
  }
  catch (JobExecutionAlreadyRunningException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job execution already running",
        jobName, parameters), e);
  }
  catch (JobRestartException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job not restartable", jobName,
        parameters), e);
  }
  catch (JobInstanceAlreadyCompleteException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job already complete", jobName,
        parameters), e);
  }
}
origin: org.springframework.batch/org.springframework.batch.core

public Long start(String jobName, String parameters) throws NoSuchJobException, JobInstanceAlreadyExistsException, JobParametersInvalidException {
  logger.info("Checking status of job with name=" + jobName);
  JobParameters jobParameters = jobParametersConverter.getJobParameters(PropertiesConverter
      .stringToProperties(parameters));
  if (jobRepository.isJobInstanceExists(jobName, jobParameters)) {
    throw new JobInstanceAlreadyExistsException(String.format(
        "Cannot start a job instance that already exists with name=%s and parameters=%s", jobName,
        parameters));
  }
  Job job = jobRegistry.getJob(jobName);
  logger.info(String.format("Attempting to launch job with name=%s and parameters=%s", jobName, parameters));
  try {
    return jobLauncher.run(job, jobParameters).getId();
  }
  catch (JobExecutionAlreadyRunningException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job execution already running",
        jobName, parameters), e);
  }
  catch (JobRestartException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job not restartable", jobName,
        parameters), e);
  }
  catch (JobInstanceAlreadyCompleteException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job already complete", jobName,
        parameters), e);
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

@Override
public Long start(String jobName, String parameters) throws NoSuchJobException, JobInstanceAlreadyExistsException, JobParametersInvalidException {
  logger.info("Checking status of job with name=" + jobName);
  JobParameters jobParameters = jobParametersConverter.getJobParameters(PropertiesConverter
      .stringToProperties(parameters));
  if (jobRepository.isJobInstanceExists(jobName, jobParameters)) {
    throw new JobInstanceAlreadyExistsException(String.format(
        "Cannot start a job instance that already exists with name=%s and parameters=%s", jobName,
        parameters));
  }
  Job job = jobRegistry.getJob(jobName);
  logger.info(String.format("Attempting to launch job with name=%s and parameters=%s", jobName, parameters));
  try {
    return jobLauncher.run(job, jobParameters).getId();
  }
  catch (JobExecutionAlreadyRunningException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job execution already running",
        jobName, parameters), e);
  }
  catch (JobRestartException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job not restartable", jobName,
        parameters), e);
  }
  catch (JobInstanceAlreadyCompleteException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job already complete", jobName,
        parameters), e);
  }
}
origin: apache/servicemix-bundles

@Override
public Long start(String jobName, String parameters) throws NoSuchJobException, JobInstanceAlreadyExistsException, JobParametersInvalidException {
  logger.info("Checking status of job with name=" + jobName);
  JobParameters jobParameters = jobParametersConverter.getJobParameters(PropertiesConverter
      .stringToProperties(parameters));
  if (jobRepository.isJobInstanceExists(jobName, jobParameters)) {
    throw new JobInstanceAlreadyExistsException(String.format(
        "Cannot start a job instance that already exists with name=%s and parameters=%s", jobName,
        parameters));
  }
  Job job = jobRegistry.getJob(jobName);
  logger.info(String.format("Attempting to launch job with name=%s and parameters=%s", jobName, parameters));
  try {
    return jobLauncher.run(job, jobParameters).getId();
  }
  catch (JobExecutionAlreadyRunningException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job execution already running",
        jobName, parameters), e);
  }
  catch (JobRestartException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job not restartable", jobName,
        parameters), e);
  }
  catch (JobInstanceAlreadyCompleteException e) {
    throw new UnexpectedJobExecutionException(String.format(ILLEGAL_STATE_MSG, "job already complete", jobName,
        parameters), e);
  }
}
org.springframework.batch.core.launchJobInstanceAlreadyExistsException

Javadoc

Checked exception to indicate that a required Job is not available.

Most used methods

  • <init>

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • JPanel (javax.swing)
  • Top plugins for WebStorm
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