当前位置: 首页>>代码示例>>Java>>正文


Java JobRegistry类代码示例

本文整理汇总了Java中org.springframework.batch.core.configuration.JobRegistry的典型用法代码示例。如果您正苦于以下问题:Java JobRegistry类的具体用法?Java JobRegistry怎么用?Java JobRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JobRegistry类属于org.springframework.batch.core.configuration包,在下文中一共展示了JobRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的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();
}
 
开发者ID:iisi-nj,项目名称:GemFireLite,代码行数:20,代码来源:Test1.java

示例2: main

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的package包/类
public static void main(String[] args) throws JobExecutionAlreadyRunningException, JobRestartException,
        JobInstanceAlreadyCompleteException, JobParametersInvalidException, DuplicateJobException {
    ConfigurableApplicationContext ctx = SpringApplication.run(Application.class, args);

    Job simpleJob = ctx.getBean("simpleJob", Job.class);
    JobRegistry jobRegistry = ctx.getBean("jobRegistry", JobRegistry.class);
    jobRegistry.register(new ReferenceJobFactory(simpleJob));
    
    //JobRepository jobRepository = ctx.getBean("jobRepository", JobRepository.class);
    //JobInstance jobInstance = jobRepository.createJobInstance("simpleJob", new JobParameters());
    // JobParameters jobParameters = ctx.getBean("basicParameters", JobParameters.class);
    //
    //JobRegistry jobRegistry = ctx.getBean("mapJobRegistry", JobRegistry.class);
    // jobRegistry.register();
    // jobLauncher.run(job, jobParameters);
}
 
开发者ID:selimok,项目名称:working-examples,代码行数:17,代码来源:Application.java

示例3: JobServiceImpl

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的package包/类
public JobServiceImpl(JobExplorer jobExplorer, JobOperator jobOperator, JobLauncher jobLauncher, JobRegistry jobRegistry,
                      JobRepository jobRepository) {
	this.jobExplorer = jobExplorer;
	this.jobOperator = jobOperator;
	this.jobLauncher = jobLauncher;
	this.jobRegistry = jobRegistry;
	this.jobRepository = jobRepository;
}
 
开发者ID:namics,项目名称:spring-batch-support,代码行数:9,代码来源:JobServiceImpl.java

示例4: jobService

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的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);
}
 
开发者ID:namics,项目名称:spring-batch-support,代码行数:9,代码来源:BatchConfig.java

示例5: jobService

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的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);
}
 
开发者ID:namics,项目名称:spring-batch-support,代码行数:10,代码来源:SpringBatchDefaultServiceConfiguration.java

示例6: jobRegistrar

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的package包/类
@Bean
public AutomaticJobRegistrar jobRegistrar(JobRegistry jobRegistry) throws Exception {
	AutomaticJobRegistrar registrar = new AutomaticJobRegistrar();
	registrar.setJobLoader(new DefaultJobLoader(jobRegistry));
	for (ApplicationContextFactory factory : applicationContext.getBeansOfType(ApplicationContextFactory.class).values()) {
		registrar.addApplicationContextFactory(factory);
	}
	return registrar;
}
 
开发者ID:namics,项目名称:spring-batch-support,代码行数:10,代码来源:SpringBatchSupportStarterAutoConfiguration.java

示例7: testServletConfiguration

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的package包/类
@Test
public void testServletConfiguration() throws Exception {
	ClassPathXmlApplicationContext parent = new ClassPathXmlApplicationContext(
			"classpath:/org/springframework/batch/admin/web/resources/webapp-config.xml");
	ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
			new String[] { "classpath:/org/springframework/batch/admin/web/resources/servlet-config.xml" }, parent);

	assertTrue(context.containsBean("jobRepository"));
	String[] beanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(context.getBeanFactory(),
			JobController.class);
	assertEquals(1, beanNames.length);

	Job job = context.getBean(JobRegistry.class).getJob("job1");
	final JobExecution jobExecution = parent.getBean(JobLauncher.class).run(job,
			new JobParametersBuilder().addString("fail", "false").toJobParameters());

	new DirectPoller<BatchStatus>(100).poll(new Callable<BatchStatus>() {
		public BatchStatus call() throws Exception {
			BatchStatus status = jobExecution.getStatus();
			if (status.isLessThan(BatchStatus.STOPPED) && status!=BatchStatus.COMPLETED) {
				return null;
			}
			return status;
		}
	}).get(2000, TimeUnit.MILLISECONDS);

	context.close();
	parent.close();

	assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus());

}
 
开发者ID:maldiny,项目名称:Spring-Batch-en-Castellano,代码行数:33,代码来源:BootstrapTests.java

示例8: main

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的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();
  }
 
}
 
开发者ID:iisi-nj,项目名称:GemFireLite,代码行数:31,代码来源:TestSubContext.java

示例9: BatchController

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的package包/类
public BatchController(final JobRegistry jobRegistry, final JobExplorer jobExplorer, final BatchOperator batchOperator,
		final JobParameterInfoRegistry parameterInfos) {
	this.jobRegistry = jobRegistry;
	this.jobExplorer = jobExplorer;
	this.batchOperator = batchOperator;
	this.parameterInfos = parameterInfos;
}
 
开发者ID:phjardas,项目名称:spring-batch-tools,代码行数:8,代码来源:BatchController.java

示例10: jobRegistry

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的package包/类
@Bean
public JobRegistry jobRegistry() {
    return new MapJobRegistry() {
        @Override
        public Set<String> getJobNames() {
            return new TreeSet<>(super.getJobNames());
        }
    };
    
}
 
开发者ID:CeON,项目名称:saos,代码行数:11,代码来源:BatchCoreConfiguration.java

示例11: JobOperationsController

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的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;
}
 
开发者ID:codecentric,项目名称:spring-boot-starter-batch-web,代码行数:13,代码来源:JobOperationsController.java

示例12: MyOwnJobService

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的package包/类
public MyOwnJobService(JobExplorer jobExplorer, JobOperator jobOperator, JobLauncher jobLauncher, JobRegistry jobRegistry, JobRepository jobRepository) {
	super(jobExplorer, jobOperator, jobLauncher, jobRegistry, jobRepository);
}
 
开发者ID:namics,项目名称:spring-batch-support,代码行数:4,代码来源:MyOwnJobService.java

示例13: jobService

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的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);
}
 
开发者ID:namics,项目名称:spring-batch-support,代码行数:5,代码来源:OwnServiceConfiguration.java

示例14: jobRegistry

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的package包/类
@Bean
public JobRegistry jobRegistry() {
	return new MapJobRegistry();
}
 
开发者ID:vadivelmurugesan,项目名称:spring-batch-admin,代码行数:5,代码来源:RootConfig.java

示例15: getJobRegistry

import org.springframework.batch.core.configuration.JobRegistry; //导入依赖的package包/类
public JobRegistry getJobRegistry() {
    return jobRegistry;
}
 
开发者ID:hzwy23,项目名称:batch-scheduler,代码行数:4,代码来源:QuartzJobLauncher.java


注:本文中的org.springframework.batch.core.configuration.JobRegistry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。