Class ApplicationContextJobFactory
java.lang.Object
org.springframework.batch.core.configuration.support.ApplicationContextJobFactory
- All Implemented Interfaces:
JobFactory
A
JobFactory that creates its own ApplicationContext and pulls a bean
out when asked to create a Job.- Author:
- Dave Syer
-
Constructor Summary
ConstructorsConstructorDescriptionApplicationContextJobFactory(String jobName, ApplicationContextFactory applicationContextFactory) -
Method Summary
Modifier and TypeMethodDescriptionfinal JobCreate anApplicationContextfrom the factory provided and pull out a bean with the name given during initialization.Return the name of the instance passed in on initialization.
-
Constructor Details
-
ApplicationContextJobFactory
public ApplicationContextJobFactory(String jobName, ApplicationContextFactory applicationContextFactory) - Parameters:
jobName- the ID of theJobin the application context to be created.applicationContextFactory- a factory for an application context that contains a job with the job name provided.
-
-
Method Details
-
createJob
Create anApplicationContextfrom the factory provided and pull out a bean with the name given during initialization.- Specified by:
createJobin interfaceJobFactory- Returns:
- The
Job. - See Also:
-
getJobName
Return the name of the instance passed in on initialization.- Specified by:
getJobNamein interfaceJobFactory- Returns:
- The
Stringthat contains theJobname. - See Also:
-