org.spicefactory.cinnamon.config.spring
Class SpringConfigurationBuilder

java.lang.Object
  extended by org.spicefactory.cinnamon.config.shared.AbstractConfigurationBuilder
      extended by org.spicefactory.cinnamon.config.spring.SpringConfigurationBuilder
All Implemented Interfaces:
ConfigurationBuilder

public class SpringConfigurationBuilder
extends AbstractConfigurationBuilder

Processes a Spring ApplicationContext assembling all configuration artifacts needed to populate a CinnamonConfig instance.

Author:
Jens Halm

Constructor Summary
SpringConfigurationBuilder()
          Creates a new instance using Springs root WebApplicationContext.
SpringConfigurationBuilder(ApplicationContext context)
          Creates a new instance using the given ApplicationContext.
SpringConfigurationBuilder(Resource resource)
          Creates a new instance using the given Spring Resource as XML input for the ApplicationContext.
SpringConfigurationBuilder(Resource resource)
          Creates a new instance using the given Spicelib Resource as XML input for the ApplicationContext.
 
Method Summary
 CinnamonConfig build()
          Processes the Spring ApplicationContext assembling all Cinnamon configuration artifacts contained in that context and creates and populates a new CinnamonConfig instance.
 void init(Map<String,String> initMap, Map<String,Object> applicationMap)
          Initializes the ServiceFactory.
 
Methods inherited from class org.spicefactory.cinnamon.config.shared.AbstractConfigurationBuilder
getApplicationMap, getInitMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringConfigurationBuilder

public SpringConfigurationBuilder()
Creates a new instance using Springs root WebApplicationContext. This implementation assumes that the WebApplicationContext is contained in the applicationMap under the default key.


SpringConfigurationBuilder

public SpringConfigurationBuilder(Resource resource)
Creates a new instance using the given Spring Resource as XML input for the ApplicationContext.

Parameters:
resource - the Spring Resource to use as XML input for the ApplicationContext

SpringConfigurationBuilder

public SpringConfigurationBuilder(Resource resource)
Creates a new instance using the given Spicelib Resource as XML input for the ApplicationContext.

Parameters:
resource - the Spicelib Resource to use as XML input for the ApplicationContext

SpringConfigurationBuilder

public SpringConfigurationBuilder(ApplicationContext context)
Creates a new instance using the given ApplicationContext.

Parameters:
context - the ApplicationContext to process
Method Detail

init

public void init(Map<String,String> initMap,
                 Map<String,Object> applicationMap)
Description copied from interface: ConfigurationBuilder
Initializes the ServiceFactory. Will only be called once by the framework at application startup.

Specified by:
init in interface ConfigurationBuilder
Overrides:
init in class AbstractConfigurationBuilder
Parameters:
initMap - the initialisation parameters (taken from ServletConfig in a web application)
applicationMap - the application attributes (taken from ServletContext in a web application)

build

public CinnamonConfig build()
Processes the Spring ApplicationContext assembling all Cinnamon configuration artifacts contained in that context and creates and populates a new CinnamonConfig instance.

Returns:
a fully populated CinnamonConfig instance