org.codehaus.groovy.grails.commons.spring
Class GrailsRuntimeConfigurator

java.lang.Object
  extended by org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator
All Implemented Interfaces:
ApplicationContextAware

public class GrailsRuntimeConfigurator
extends Object
implements ApplicationContextAware

A class that handles the runtime configuration of the Grails ApplicationContext

Since:
0.3
Author:
Graeme Rocher

Field Summary
static String BEAN_ID
           
static String CLASS_EDITOR_BEAN
           
static String CLASS_LOADER_BEAN
           
static String CUSTOM_EDITORS_BEAN
           
static String DATA_SOURCE_BEAN
           
static String DIALECT_DETECTOR_BEAN
           
static String EXCEPTION_HANDLER_BEAN
           
static String GRAILS_URL_MAPPINGS
           
static String HIBERNATE_PROPERTIES_BEAN
           
static String MESSAGE_SOURCE_BEAN
           
static String MULTIPART_RESOLVER_BEAN
           
static String OPEN_SESSION_IN_VIEW_INTERCEPTOR_BEAN
           
static String SESSION_FACTORY_BEAN
           
static String SPRING_RESOURCES_CLASS
           
static String SPRING_RESOURCES_GROOVY
           
static String SPRING_RESOURCES_XML
           
static String TRANSACTION_MANAGER_BEAN
           
 
Constructor Summary
GrailsRuntimeConfigurator(GrailsApplication application)
           
GrailsRuntimeConfigurator(GrailsApplication application, ApplicationContext parent)
           
 
Method Summary
 WebApplicationContext configure()
          Configures the Grails application context at runtime
 WebApplicationContext configure(ServletContext context)
          Configures the Grails application context at runtime
 WebApplicationContext configure(ServletContext context, boolean loadExternalBeans)
           
 WebApplicationContext configureDomainOnly()
           
 GrailsPluginManager getPluginManager()
           
static void loadSpringGroovyResources(RuntimeSpringConfiguration config, ClassLoader classLoader)
           
static void loadSpringGroovyResourcesIntoContext(RuntimeSpringConfiguration config, ClassLoader classLoader, GenericApplicationContext context)
           
 void reconfigure(GrailsApplicationContext current, ServletContext servletContext, boolean loadExternalBeans)
           
 void registerService(GrailsServiceClass grailsServiceClass, GrailsApplicationContext context)
          Registers a new service with the specified application context
static void registerTagLibrary(GrailsTagLibClass tagLibClass, GrailsApplicationContext context)
          Registers a tag library with the specified grails application context
 void setApplicationContext(ApplicationContext applicationContext)
           
 void setLoadExternalPersistenceConfig(boolean b)
           
 void setPluginManager(GrailsPluginManager manager)
           
 void updateDomainClass(GrailsDomainClass domainClass, GrailsApplicationContext context)
          Updates an existing domain class within the application context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEAN_ID

public static final String BEAN_ID
See Also:
Constant Field Values

GRAILS_URL_MAPPINGS

public static final String GRAILS_URL_MAPPINGS
See Also:
Constant Field Values

SPRING_RESOURCES_XML

public static final String SPRING_RESOURCES_XML
See Also:
Constant Field Values

SPRING_RESOURCES_GROOVY

public static final String SPRING_RESOURCES_GROOVY
See Also:
Constant Field Values

SPRING_RESOURCES_CLASS

public static final String SPRING_RESOURCES_CLASS
See Also:
Constant Field Values

OPEN_SESSION_IN_VIEW_INTERCEPTOR_BEAN

public static final String OPEN_SESSION_IN_VIEW_INTERCEPTOR_BEAN
See Also:
Constant Field Values

TRANSACTION_MANAGER_BEAN

public static final String TRANSACTION_MANAGER_BEAN
See Also:
Constant Field Values

HIBERNATE_PROPERTIES_BEAN

public static final String HIBERNATE_PROPERTIES_BEAN
See Also:
Constant Field Values

DIALECT_DETECTOR_BEAN

public static final String DIALECT_DETECTOR_BEAN
See Also:
Constant Field Values

SESSION_FACTORY_BEAN

public static final String SESSION_FACTORY_BEAN
See Also:
Constant Field Values

DATA_SOURCE_BEAN

public static final String DATA_SOURCE_BEAN
See Also:
Constant Field Values

MESSAGE_SOURCE_BEAN

public static final String MESSAGE_SOURCE_BEAN
See Also:
Constant Field Values

MULTIPART_RESOLVER_BEAN

public static final String MULTIPART_RESOLVER_BEAN
See Also:
Constant Field Values

EXCEPTION_HANDLER_BEAN

public static final String EXCEPTION_HANDLER_BEAN
See Also:
Constant Field Values

CUSTOM_EDITORS_BEAN

public static final String CUSTOM_EDITORS_BEAN
See Also:
Constant Field Values

CLASS_EDITOR_BEAN

public static final String CLASS_EDITOR_BEAN
See Also:
Constant Field Values

CLASS_LOADER_BEAN

public static final String CLASS_LOADER_BEAN
See Also:
Constant Field Values
Constructor Detail

GrailsRuntimeConfigurator

public GrailsRuntimeConfigurator(GrailsApplication application)

GrailsRuntimeConfigurator

public GrailsRuntimeConfigurator(GrailsApplication application,
                                 ApplicationContext parent)
Method Detail

registerService

public void registerService(GrailsServiceClass grailsServiceClass,
                            GrailsApplicationContext context)
Registers a new service with the specified application context

Parameters:
grailsServiceClass - The service class to register
context - The app context to register with

registerTagLibrary

public static void registerTagLibrary(GrailsTagLibClass tagLibClass,
                                      GrailsApplicationContext context)
Registers a tag library with the specified grails application context

Parameters:
tagLibClass - That tag library class
context - The application context

updateDomainClass

public void updateDomainClass(GrailsDomainClass domainClass,
                              GrailsApplicationContext context)
Updates an existing domain class within the application context

Parameters:
domainClass - The domain class to update
context - The context

configure

public WebApplicationContext configure()
Configures the Grails application context at runtime

Returns:
A WebApplicationContext instance

configure

public WebApplicationContext configure(ServletContext context)
Configures the Grails application context at runtime

Parameters:
context - A ServletContext instance
Returns:
An ApplicationContext instance

configure

public WebApplicationContext configure(ServletContext context,
                                       boolean loadExternalBeans)

reconfigure

public void reconfigure(GrailsApplicationContext current,
                        ServletContext servletContext,
                        boolean loadExternalBeans)

configureDomainOnly

public WebApplicationContext configureDomainOnly()

loadSpringGroovyResources

public static void loadSpringGroovyResources(RuntimeSpringConfiguration config,
                                             ClassLoader classLoader)

loadSpringGroovyResourcesIntoContext

public static void loadSpringGroovyResourcesIntoContext(RuntimeSpringConfiguration config,
                                                        ClassLoader classLoader,
                                                        GenericApplicationContext context)

setLoadExternalPersistenceConfig

public void setLoadExternalPersistenceConfig(boolean b)

setPluginManager

public void setPluginManager(GrailsPluginManager manager)

getPluginManager

public GrailsPluginManager getPluginManager()

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException


Copyright (c) 2005-2006 The Grails project