@CompileStatic class GrailsApplicationBuilder extends java.lang.Object
Created by jameskleeh on 5/31/17.
| Modifiers | Name | Description |
|---|---|---|
static class |
GrailsApplicationBuilder.IncludedPluginBeansPostProcessor |
Registers the included plugins' doWithSpring and beanRegistrar beans before the
configuration classes are read, where an application's early phase registers them, so a
@ConditionalOnMissingBean bean - the framework's, a plugin's own or the test's - backs
off from them. |
static class |
GrailsApplicationBuilder.TestRuntimeGrailsApplicationPostProcessor |
| Modifiers | Name | Description |
|---|---|---|
static boolean |
isServletApiPresent |
| Type | Name and description |
|---|---|
static java.lang.String |
AUTO_CONFIGURATION_SUFFIX |
static java.util.Set |
DEFAULT_INCLUDED_PLUGINS |
static java.lang.String |
DO_WITH_CONFIG_PROPERTY_SOURCEThe property source publishToEnvironment adds. |
static java.lang.String |
GRAILS_PLUGIN_SUFFIX |
static java.lang.String |
POST_PROCESSOR_BEAN_NAME |
BeanRegistrar |
beanRegistrar |
java.util.Set<java.lang.Class<?>> |
configurationClasses |
Closure |
doWithConfig |
Closure |
doWithSpring |
GrailsApplication |
grailsApplication |
java.util.Set<java.lang.String> |
includePlugins |
boolean |
loadExternalBeans |
boolean |
localOverride |
java.lang.Object |
servletContext |
| Constructor and description |
|---|
GrailsApplicationBuilder() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected static java.util.Map<java.lang.String, BeanDefinition> |
beanDefinitionsDeclaredBy(java.util.Collection<java.lang.Class<?>> configurationClasses, BeanDefinitionRegistry registry)The bean definitions the test's configuration classes declared, a group(...) nested in
one included, read off the @Bean method each came from. |
|
GrailsApplicationBuilder |
build() |
|
protected ConfigurableApplicationContext |
createMainContext(java.lang.Object servletContext) |
|
protected java.lang.Object |
createServletContext() |
|
void |
defineBeans(Closure callable) |
|
void |
defineBeans(GrailsApplication grailsApplication, Closure callable) |
|
void |
executeDoWithSpringCallback(GrailsApplication grailsApplication) |
|
protected static java.lang.String |
generatedAutoConfigurationName(java.lang.Class<?> pluginClass)The class a plugin's beans block compiles to, named as @GrailsBeans names it:
the plugin's autoConfigurationName, in the plugin's package unless it names one; else
FooGrailsPlugin gives FooAutoConfiguration, and any other name has
AutoConfiguration appended, in the plugin's package. |
|
protected static java.util.Set<java.lang.String> |
generatedAutoConfigurationNames(PluginDiscovery discovery)The class each included plugin's beans block compiles to. |
|
protected void |
prepareContext(ConfigurableApplicationContext applicationContext, ConfigurableBeanFactory beanFactory) |
|
protected static void |
publishToEnvironment(java.util.Properties before, GrailsApplication grailsApplication)Puts what the test's doWithConfig changed into the Spring Environment too, ahead
of every other property source. |
|
void |
registerBeans(GrailsApplication grailsApplication) |
|
protected void |
registerGrailsAppPostProcessorBean(ConfigurableBeanFactory beanFactory, PluginDiscovery pluginDiscovery) |
|
protected PluginDiscovery |
registerPluginDiscoveryBean(ConfigurableApplicationContext applicationContext, ConfigurableBeanFactory beanFactory) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
The property source publishToEnvironment adds.
The bean definitions the test's configuration classes declared, a group(...) nested in
one included, read off the @Bean method each came from.
The class a plugin's beans block compiles to, named as @GrailsBeans names it:
the plugin's autoConfigurationName, in the plugin's package unless it names one; else
FooGrailsPlugin gives FooAutoConfiguration, and any other name has
AutoConfiguration appended, in the plugin's package.
The class each included plugin's beans block compiles to. Only classes the build listed
as auto-configurations are registered, so a name that merely matches is never picked up. The
framework's own are registered regardless, with every org.grails auto-configuration.
Puts what the test's doWithConfig changed into the Spring Environment too, ahead
of every other property source. grailsApplication.config alone reaches placeholders but
not conditions: @ConditionalOnProperty and a beans block's
.conditionalOnProperty(...) read the environment. This runs before the configuration
classes are read, so their conditions see it.