本文整理汇总了Java中org.springframework.batch.core.launch.JobOperator类的典型用法代码示例。如果您正苦于以下问题:Java JobOperator类的具体用法?Java JobOperator怎么用?Java JobOperator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JobOperator类属于org.springframework.batch.core.launch包,在下文中一共展示了JobOperator类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
public static void main(final String[] cmdArgs) {
try (final AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext()) {
ctx.getEnvironment().addActiveProfile(Constants.STANDARD_DATABASE);
ctx.register(LHHuntingClubCmdContext.class);
ctx.refresh();
ctx.start();
try {
ctx.getBean(LiquibaseConfig.class).upgradeDatabase();
ctx.getBean(JobOperator.class).startNextInstance(LHHuntingClubBatchConfig.JOB_NAME);
} catch (Exception e) {
LOG.error("Job execution has failed with error", e);
}
}
}
示例2: main
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
ServerConfigHelper.initLog4j("log4j-shell.xml");
ClassPathXmlApplicationContext ctx = Util.initContext("batch/new-context.xml","batch-file-ac01.xml");
JobLauncher launch = ctx.getBean(JobLauncher.class);
JobExplorer epl=ctx.getBean(JobExplorer.class);
JobRegistry reg =ctx.getBean(JobRegistry.class);
JobOperator jop=ctx.getBean(JobOperator.class);
System.out.println(epl.getJobNames()+" "+reg.getJobNames()+" "+jop.toString());
for(String bn: ctx.getBeanFactory().getBeanDefinitionNames())
{
System.out.println(bn);
}
ctx.close();
}
示例3: jobService
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
@Bean
public JobService jobService(JobOperator batchJobOperator,
JobRegistry batchJobRegistry,
JobExplorer jobExplorer,
JobLauncher jobLauncher,
JobRepository jobRepository) throws Exception {
return new JobServiceImpl(jobExplorer, batchJobOperator, jobLauncher, batchJobRegistry, jobRepository);
}
示例4: jobService
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(JobService.class)
public JobService jobService(JobOperator batchJobOperator,
JobRegistry batchJobRegistry,
JobExplorer jobExplorer,
JobLauncher jobLauncher,
JobRepository jobRepository) throws Exception {
return new JobServiceImpl(jobExplorer, batchJobOperator, jobLauncher, batchJobRegistry, jobRepository);
}
示例5: jobOperator
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(JobOperator.class)
public SimpleJobOperator jobOperator(JobExplorer jobExplorer, JobLauncher jobLauncher,
ListableJobLocator jobRegistry, JobRepository jobRepository)
throws Exception {
SimpleJobOperator factory = new SimpleJobOperator();
factory.setJobExplorer(jobExplorer);
factory.setJobLauncher(jobLauncher);
factory.setJobRegistry(jobRegistry);
factory.setJobRepository(jobRepository);
if (this.jobParametersConverter != null) {
factory.setJobParametersConverter(this.jobParametersConverter);
}
return factory;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:16,代码来源:BatchAutoConfiguration.java
示例6: main
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
public static void main(String[] args)
{
try
{
ServerConfigHelper.initConfig();
ServerConfigHelper.initLog4j("log4j-debug.xml");
ClassPathXmlApplicationContext ctx = Util.initContext("batch/new-context.xml");
JobLauncher launch = ctx.getBean(JobLauncher.class);
JobExplorer epl=ctx.getBean(JobExplorer.class);
JobRegistry reg =ctx.getBean(JobRegistry.class);
JobOperator jop=ctx.getBean(JobOperator.class);
ClassPathXmlApplicationContext ctx2 = Util.initContext(false,"batch/job-context.xml","batch-file-prod.xml");
ctx2.setParent(ctx);
ctx2.refresh();
Job job = ctx2.getBean(Job.class);
JobParametersBuilder build = new JobParametersBuilder();
build.addLong("Id", System.currentTimeMillis());
JobExecution exec= launch.run(job,build.toJobParameters());
System.out.println(reg.getJobNames());
Thread.sleep(Long.MAX_VALUE);
}
catch (Exception e)
{
e.printStackTrace();
}
}
示例7: JobMonitoringController
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
public JobMonitoringController(JobOperator jobOperator,
JobExplorer jobExplorer,
RunningExecutionTracker runningExecutionTracker) {
super();
this.jobOperator = jobOperator;
this.jobExplorer = jobExplorer;
this.runningExecutionTracker = runningExecutionTracker;
}
示例8: JobOperationsController
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
public JobOperationsController(JobOperator jobOperator,
JobExplorer jobExplorer, JobRegistry jobRegistry,
JobRepository jobRepository, JobLauncher jobLauncher,
JsrJobOperator jsrJobOperator) {
super();
this.jobOperator = jobOperator;
this.jobExplorer = jobExplorer;
this.jobRegistry = jobRegistry;
this.jobRepository = jobRepository;
this.jobLauncher = jobLauncher;
this.jsrJobOperator = jsrJobOperator;
}
示例9: mBeanExporter
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
@Bean
public MBeanExporter mBeanExporter(JobOperator jobOperator) {
Map<String, Object> map = new HashMap<>();
map.put("kr.spring.batch:name=jobOperator", jobOperator);
MBeanExporter exporter = new MBeanExporter();
exporter.setBeans(map);
return exporter;
}
示例10: EgovBatchRunner
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
/**
* EgovBatchRunner 생성자
* JobOperator, JobExplorer, JobRepository를 설정한다.
*
* @param jobOperator
* @param jobExplorer
* @param jobRepository
*/
public EgovBatchRunner(JobOperator jobOperator, JobExplorer jobExplorer,
JobRepository jobRepository) {
Assert.notNull(jobOperator, "The JobOperator is mandatory");
Assert.notNull(jobExplorer, "The JobExplorer is mandatory");
Assert.notNull(jobRepository, "The JobRepository is mandatory");
this.jobOperator = jobOperator;
this.jobExplorer = jobExplorer;
this.jobRepository = jobRepository;
}
示例11: MyOwnJobService
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
public MyOwnJobService(JobExplorer jobExplorer, JobOperator jobOperator, JobLauncher jobLauncher, JobRegistry jobRegistry, JobRepository jobRepository) {
super(jobExplorer, jobOperator, jobLauncher, jobRegistry, jobRepository);
}
示例12: jobService
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
@Bean
public JobService jobService(JobOperator batchJobOperator, JobRegistry batchJobRegistry, JobExplorer jobExplorer, JobLauncher jobLauncher, JobRepository jobRepository) throws Exception {
return new MyOwnJobService(jobExplorer, batchJobOperator, jobLauncher, batchJobRegistry, jobRepository);
}
示例13: jobOperator
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
public JobOperator jobOperator() {
return jobOperator;
}
示例14: getJobOperator
import org.springframework.batch.core.launch.JobOperator; //导入依赖的package包/类
/**
* JobOperator를 사용할 수 있도록 가져온다.
*
* @return JobOperator
*/
public JobOperator getJobOperator() {
return jobOperator;
}