Package: org.codehaus.groovy.grails.commons.spring

## [Java] Class GrailsRuntimeConfigurator

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

- All Implemented Interfaces and Traits:
    org.springframework.context.ApplicationContextAware

      public class GrailsRuntimeConfigurator
      extends java.lang.Object

  Handles the runtime configuration of the Grails ApplicationContext.

  Authors:
    Graeme Rocher
  Since:
    0.3

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static java.lang.String` | `BEAN_ID` |
    `static java.lang.String` | `CLASS_EDITOR_BEAN` |
    `static java.lang.String` | `CLASS_LOADER_BEAN` |
    `static java.lang.String` | `CUSTOM_EDITORS_BEAN` |
    `static java.lang.String` | `DATA_SOURCE_BEAN` |
    `protected static java.lang.String` | `DEVELOPMENT_SPRING_RESOURCES_XML` |
    `static java.lang.String` | `DIALECT_DETECTOR_BEAN` |
    `static java.lang.String` | `EXCEPTION_HANDLER_BEAN` |
    `static java.lang.String` | `GRAILS_INITIALIZING` |
    `static java.lang.String` | `GRAILS_URL_MAPPINGS` |
    `static java.lang.String` | `HIBERNATE_PROPERTIES_BEAN` |
    `static java.lang.String` | `MESSAGE_SOURCE_BEAN` |
    `static java.lang.String` | `MULTIPART_RESOLVER_BEAN` |
    `static java.lang.String` | `OPEN_SESSION_IN_VIEW_INTERCEPTOR_BEAN` |
    `static java.lang.String` | `SESSION_FACTORY_BEAN` |
    `static java.lang.String` | `SPRING_RESOURCES_CLASS` |
    `static java.lang.String` | `SPRING_RESOURCES_GROOVY` |
    `static java.lang.String` | `SPRING_RESOURCES_XML` |
    `static java.lang.String` | `TRANSACTION_MANAGER_BEAN` |
    `protected GrailsApplication` | `application` |
    `protected org.springframework.context.ApplicationContext` | `parent` |
    `protected GrailsPluginManager` | `pluginManager` |
    `protected WebRuntimeSpringConfiguration` | `webSpringConfig` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GrailsRuntimeConfigurator (GrailsApplication application)`
    `GrailsRuntimeConfigurator (GrailsApplication application, org.springframework.context.ApplicationContext parent)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `org.springframework.web.context.WebApplicationContext` | `configure()` GrailsPlugin.groovy", application); } Holders.setPluginManager(pluginManager); }
    `org.springframework.web.context.WebApplicationContext` | `configure(javax.servlet.ServletContext context)` Configures the Grails application context at runtime
    `org.springframework.web.context.WebApplicationContext` | `configure(javax.servlet.ServletContext context, boolean loadExternalBeans)`
    `org.springframework.web.context.WebApplicationContext` | `configureDomainOnly()`
    `protected WebRuntimeSpringConfiguration` | `createWebRuntimeSpringConfiguration(GrailsApplication app, org.springframework.context.ApplicationContext parentCtx, java.lang.ClassLoader classLoader)`
    `protected void` | `doPostResourceConfiguration(GrailsApplication app, RuntimeSpringConfiguration springConfig)`
    `GrailsPluginManager` | `getPluginManager()`
    `protected void` | `initializeContext(org.springframework.context.ApplicationContext mainContext)`
    `protected void` | `initializePluginManager()`
    `static void` | `loadExternalSpringConfig(RuntimeSpringConfiguration config, GrailsApplication application)` Loads any external Spring configuration into the given RuntimeSpringConfiguration object.
    `static void` | `loadSpringGroovyResources(RuntimeSpringConfiguration config, GrailsApplication application)`
    `static void` | `loadSpringGroovyResourcesIntoContext(RuntimeSpringConfiguration config, GrailsApplication application, org.springframework.context.support.GenericApplicationContext context)`
    `protected void` | `performPostProcessing(org.springframework.web.context.WebApplicationContext ctx)`
    `void` | `reconfigure(GrailsApplicationContext current, javax.servlet.ServletContext servletContext, boolean loadExternalBeans)`
    `protected void` | `registerParentBeanFactoryPostProcessors(WebRuntimeSpringConfiguration springConfig)`
    `static BeanBuilder` | `reloadSpringResourcesConfig(RuntimeSpringConfiguration config, GrailsApplication application, java.lang.Class<?> groovySpringResourcesClass)`
    `static void` | `reset()` Resets the GrailsRumtimeConfigurator.
    `void` | `setApplicationContext(org.springframework.context.ApplicationContext applicationContext)`
    `void` | `setLoadExternalPersistenceConfig(boolean b)`
    `void` | `setPluginManager(GrailsPluginManager manager)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### public static final java.lang.String BEAN_ID

    - #### public static final java.lang.String CLASS_EDITOR_BEAN

    - #### public static final java.lang.String CLASS_LOADER_BEAN

    - #### public static final java.lang.String CUSTOM_EDITORS_BEAN

    - #### public static final java.lang.String DATA_SOURCE_BEAN

    - #### protected static final java.lang.String DEVELOPMENT_SPRING_RESOURCES_XML

    - #### public static final java.lang.String DIALECT_DETECTOR_BEAN

    - #### public static final java.lang.String EXCEPTION_HANDLER_BEAN

    - #### public static final java.lang.String GRAILS_INITIALIZING

    - #### public static final java.lang.String GRAILS_URL_MAPPINGS

    - #### public static final java.lang.String HIBERNATE_PROPERTIES_BEAN

    - #### public static final java.lang.String MESSAGE_SOURCE_BEAN

    - #### public static final java.lang.String MULTIPART_RESOLVER_BEAN

    - #### public static final java.lang.String OPEN_SESSION_IN_VIEW_INTERCEPTOR_BEAN

    - #### public static final java.lang.String SESSION_FACTORY_BEAN

    - #### public static final java.lang.String SPRING_RESOURCES_CLASS

    - #### public static final java.lang.String SPRING_RESOURCES_GROOVY

    - #### public static final java.lang.String SPRING_RESOURCES_XML

    - #### public static final java.lang.String TRANSACTION_MANAGER_BEAN

    - #### protected GrailsApplication application

    - #### protected org.springframework.context.ApplicationContext parent

    - #### protected GrailsPluginManager pluginManager

    - #### protected WebRuntimeSpringConfiguration webSpringConfig

  - ### Constructor Detail

    - #### public GrailsRuntimeConfigurator(GrailsApplication application)

    - #### public GrailsRuntimeConfigurator(GrailsApplication application, org.springframework.context.ApplicationContext parent)

  - ### Method Detail

    - #### public org.springframework.web.context.WebApplicationContext configure()

      GrailsPlugin.groovy", application); } Holders.setPluginManager(pluginManager); } /** Configures the Grails application context at runtime.

      Returns:
        A WebApplicationContext instance

    - #### public org.springframework.web.context.WebApplicationContext configure(javax.servlet.ServletContext context)

      Configures the Grails application context at runtime

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

    - #### public org.springframework.web.context.WebApplicationContext configure(javax.servlet.ServletContext context, boolean loadExternalBeans)

    - #### public org.springframework.web.context.WebApplicationContext configureDomainOnly()

    - #### protected WebRuntimeSpringConfiguration createWebRuntimeSpringConfiguration(GrailsApplication app, org.springframework.context.ApplicationContext parentCtx, java.lang.ClassLoader classLoader)

    - #### protected void doPostResourceConfiguration(GrailsApplication app, RuntimeSpringConfiguration springConfig)

    - #### public GrailsPluginManager getPluginManager()

    - #### protected void initializeContext(org.springframework.context.ApplicationContext mainContext)

    - #### protected void initializePluginManager()

    - #### public static void loadExternalSpringConfig(RuntimeSpringConfiguration config, GrailsApplication application)

      Loads any external Spring configuration into the given RuntimeSpringConfiguration object.

      Parameters:
        `config` - The config instance

    - #### public static void loadSpringGroovyResources(RuntimeSpringConfiguration config, GrailsApplication application)

    - #### public static void loadSpringGroovyResourcesIntoContext(RuntimeSpringConfiguration config, GrailsApplication application, org.springframework.context.support.GenericApplicationContext context)

    - #### protected void performPostProcessing(org.springframework.web.context.WebApplicationContext ctx)

    - #### public void reconfigure(GrailsApplicationContext current, javax.servlet.ServletContext servletContext, boolean loadExternalBeans)

    - #### @java.lang.SuppressWarnings("rawtypes") protected void registerParentBeanFactoryPostProcessors(WebRuntimeSpringConfiguration springConfig)

    - #### public static BeanBuilder reloadSpringResourcesConfig(RuntimeSpringConfiguration config, GrailsApplication application, java.lang.Class<?> groovySpringResourcesClass)

    - #### public static void reset()

      Resets the GrailsRumtimeConfigurator.

    - #### public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)

    - #### public void setLoadExternalPersistenceConfig(boolean b)

    - #### public void setPluginManager(GrailsPluginManager manager)