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

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • 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