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 Job
Create anApplicationContext
from the factory provided and pull out a bean with the name given during initialization.Just return the name of 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 createdapplicationContextFactory
- a factory for an application context containing 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
Just return the name of instance passed in on initialization.- Specified by:
getJobName
in interfaceJobFactory
- Returns:
- The
String
containing theJob
name. - See Also:
-