org.springframework.batch.core.configuration.support
Class ClassPathXmlApplicationContextJobFactory

java.lang.Object
  extended by org.springframework.batch.core.configuration.support.ClassPathXmlApplicationContextJobFactory
All Implemented Interfaces:
JobFactory

public class ClassPathXmlApplicationContextJobFactory
extends Object
implements JobFactory

A JobFactory that creates its own ApplicationContext from a path supplied, and pulls a bean out when asked to create a Job.

Author:
Dave Syer

Constructor Summary
ClassPathXmlApplicationContextJobFactory(String beanName, String path, ApplicationContext parent)
           
 
Method Summary
 Job createJob()
          Create a ClassPathXmlApplicationContext from the path provided and pull out a bean with the name given during initialization.
 String getJobName()
          Return the bean name of the job in the application context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathXmlApplicationContextJobFactory

public ClassPathXmlApplicationContextJobFactory(String beanName,
                                                String path,
                                                ApplicationContext parent)
Parameters:
beanName - the id of the Job in the application context to be created
path - the path to the XML configuration containing the Job
parent - the application context to use as a parent (or null)
Method Detail

createJob

public Job createJob()
Create a ClassPathXmlApplicationContext from the path provided and pull out a bean with the name given during initialization.

Specified by:
createJob in interface JobFactory
See Also:
JobFactory.createJob()

getJobName

public String getJobName()
Return the bean name of the job in the application context. N.B. this is usually the name of the job as well, but it needn't be. The important thing is that the job can be located by this name.

Specified by:
getJobName in interface JobFactory
See Also:
JobFactory.getJobName()


Copyright © 2009 SpringSource. All Rights Reserved.