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
ConstructorDescriptionApplicationContextJobFactory
(String jobName, ApplicationContextFactory applicationContextFactory) -
Method Summary
Modifier and TypeMethodDescriptionfinal Job
Create anApplicationContext
from 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 theJob
in 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 anApplicationContext
from the factory provided and pull out a bean with the name given during initialization.- Specified by:
createJob
in interfaceJobFactory
- Returns:
- The
Job
. - See Also:
-
getJobName
Return the name of the instance passed in on initialization.- Specified by:
getJobName
in interfaceJobFactory
- Returns:
- The
String
that contains theJob
name. - See Also:
-