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

java.lang.Object
  extended by org.springframework.batch.core.configuration.support.ClassPathXmlApplicationContextFactory
All Implemented Interfaces:
ApplicationContextFactory, org.springframework.context.ApplicationContextAware

public class ClassPathXmlApplicationContextFactory
extends java.lang.Object
implements ApplicationContextFactory, org.springframework.context.ApplicationContextAware

ApplicationContextFactory implementation that takes a parent context and a path to the context to create. Each time the createApplicationContext method is called, a new ApplicationContext will be returned. It should be noted that if a path isn't set, the parent will always be returned.


Constructor Summary
ClassPathXmlApplicationContextFactory()
           
 
Method Summary
 org.springframework.context.ConfigurableApplicationContext createApplicationContext()
          Creates an ApplicationContext from the provided path.
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
          Setter for the parent application context.
 void setPath(org.springframework.core.io.Resource path)
          Setter for the path to the xml to load to create an ApplicationContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathXmlApplicationContextFactory

public ClassPathXmlApplicationContextFactory()
Method Detail

setPath

public void setPath(org.springframework.core.io.Resource path)
Setter for the path to the xml to load to create an ApplicationContext. Use imports to centralise the configuration in one file.

Parameters:
path - the resource path to the xml to load for the child context.

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Setter for the parent application context.

Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException
See Also:
ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

createApplicationContext

public org.springframework.context.ConfigurableApplicationContext createApplicationContext()
Creates an ApplicationContext from the provided path.

Specified by:
createApplicationContext in interface ApplicationContextFactory
See Also:
ApplicationContextFactory.createApplicationContext()


Copyright © 2009. All Rights Reserved.