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

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

public class ApplicationContextJobFactory
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
ApplicationContextJobFactory(ApplicationContextFactory applicationContextFactory, String jobName)
           
 
Method Summary
 Job createJob()
          Create an ApplicationContext from the factory 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

ApplicationContextJobFactory

public ApplicationContextJobFactory(ApplicationContextFactory applicationContextFactory,
                                    String jobName)
Parameters:
jobName - the id of the Job in the application context to be created
Method Detail

createJob

public Job createJob()
Create an ApplicationContext from the factory 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.