Examples of JsrJobContextFactoryBean


Examples of org.springframework.batch.core.jsr.JsrJobContextFactoryBean

      taskExecutor.execute(new Runnable() {

        @Override
        public void run() {
          JsrJobContextFactoryBean factoryBean = null;
          try {
            factoryBean = (JsrJobContextFactoryBean) batchContext.getBean("&" + JSR_JOB_CONTEXT_BEAN_NAME);
            factoryBean.setJobExecution(jobExecution);
            final Job job = batchContext.getBean(Job.class);

            if(!job.isRestartable()) {
              throw new JobRestartException("Job " + jobName + " is not restartable");
            }

            semaphore.release();
            // Initialization of the JobExecution for job level dependencies
            jobRegistry.register(job, jobExecution);
            job.execute(jobExecution);
            jobRegistry.remove(jobExecution);
          }
          catch (Exception e) {
            exceptionHolder.add(e);
          } finally {
            if(factoryBean != null) {
              factoryBean.close();
            }

            batchContext.close();

            if(semaphore.availablePermits() == 0) {
View Full Code Here

Examples of org.springframework.batch.core.jsr.JsrJobContextFactoryBean

      taskExecutor.execute(new Runnable() {

        @Override
        public void run() {
          JsrJobContextFactoryBean factoryBean = null;
          try {
            factoryBean = (JsrJobContextFactoryBean) batchContext.getBean("&" + JSR_JOB_CONTEXT_BEAN_NAME);
            factoryBean.setJobExecution(jobExecution);
            final Job job = batchContext.getBean(Job.class);
            semaphore.release();
            // Initialization of the JobExecution for job level dependencies
            jobRegistry.register(job, jobExecution);
            job.execute(jobExecution);
            jobRegistry.remove(jobExecution);
          }
          catch (Exception e) {
            exceptionHolder.add(e);
          } finally {
            if(factoryBean != null) {
              factoryBean.close();
            }

            batchContext.close();

            if(semaphore.availablePermits() == 0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.