List of usage examples for org.springframework.batch.core.configuration.support GenericApplicationContextFactory setApplicationContext
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
From source file:com.iisigroup.cap.batch.handler.BatchHandler.java
protected ApplicationContext createApplicationContextFactory(ApplicationContext parent, org.springframework.core.io.Resource resource) { GenericApplicationContextFactory applicationContextFactory = new GenericApplicationContextFactory(resource); if (parent != null) { applicationContextFactory.setApplicationContext(parent); }/*from ww w . j av a2 s . com*/ return applicationContextFactory.createApplicationContext(); }
From source file:org.springframework.batch.core.launch.support.JobRegistryBackgroundJobRunner.java
private void register(String[] paths) throws DuplicateJobException, IOException { maybeCreateJobLoader();/* w ww .j a v a 2s. c om*/ for (int i = 0; i < paths.length; i++) { Resource[] resources = parentContext.getResources(paths[i]); for (int j = 0; j < resources.length; j++) { Resource path = resources[j]; logger.info("Registering Job definitions from " + Arrays.toString(resources)); GenericApplicationContextFactory factory = new GenericApplicationContextFactory(path); factory.setApplicationContext(parentContext); jobLoader.load(factory); } } }