@groovy.util.logging.Slf4j @groovy.transform.CompileStatic class GrailsApp extends SpringApplication
Extends the SpringApplication with reloading behavior and other Grails features
| Type | Name and description |
|---|---|
ConfigurableEnvironment |
configuredEnvironment |
boolean |
developmentModeActive |
boolean |
enableBeanCreationProfiler |
| Constructor and description |
|---|
GrailsApp(java.lang.Class<?>[] sources)Create a new GrailsApp instance. |
GrailsApp(ResourceLoader resourceLoader, java.lang.Class<?>[] sources)Create a new GrailsApp instance. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected void |
compileGroovyFile(org.codehaus.groovy.control.CompilerConfiguration compilerConfig, java.io.File changedFile) |
|
protected void |
configureCliPidFileWriter()Registers a Spring Boot ApplicationPidFileWriter when the CLI has supplied a PID file path through the grails.cli.pid.file system property, so the forked development
application writes its own process id to the location the stop-app command reads. |
|
protected void |
configureDirectoryWatcher(DirectoryWatcher directoryWatcher, java.lang.String location) |
|
protected void |
configureEnvironment(ConfigurableEnvironment environment, java.lang.String[] args) |
|
protected ConfigurableApplicationContext |
createApplicationContext() |
|
protected static FileChangeListener |
createPluginManagerListener(ConfigurableApplicationContext applicationContext)Creates and returns a file change listener for notifying the plugin manager of changes. |
|
protected void |
enableDevelopmentModeWatch(Environment environment, ConfigurableApplicationContext applicationContext, java.lang.String[] args) |
|
static boolean |
isDevelopmentModeActive() |
|
protected void |
postProcessApplicationContext(ConfigurableApplicationContext applicationContext)Stashes the application source classes as a well-known singleton so that GrailsEarlyPluginRegistrationPostProcessor can perform artefact discovery before
Spring Boot auto-configuration is processed. |
|
protected java.lang.Object |
printRunStatus(ConfigurableApplicationContext applicationContext) |
|
protected void |
recompile(java.io.File changedFile, org.codehaus.groovy.control.CompilerConfiguration compilerConfig, java.lang.String location) |
|
ConfigurableApplicationContext |
run(java.lang.String[] args) |
|
static ConfigurableApplicationContext |
run(java.lang.Class<?> source, java.lang.String[] args)Static helper that can be used to run a GrailsApp from the specified source using default settings. |
|
static ConfigurableApplicationContext |
run(java.lang.Class<?>[] sources, java.lang.String[] args)Static helper that can be used to run a GrailsApp from the specified sources using default settings and user supplied arguments. |
|
static void |
setDevelopmentModeActive(boolean active) |
Create a new GrailsApp instance. The application context will load beans from the specified sources (see SpringApplication documentation for details. The instance can be customized before calling run(String...).
sources - the bean sourcesCreate a new GrailsApp instance. The application context will load beans from the specified sources (see SpringApplication documentation for details. The instance can be customized before calling run(String...).
resourceLoader - the resource loader to usesources - the bean sources Registers a Spring Boot ApplicationPidFileWriter when the CLI has supplied a PID file
path through the grails.cli.pid.file system property, so the forked development
application writes its own process id to the location the stop-app command reads.
The writer is registered before super.run() so it receives the early
ApplicationPreparedEvent that triggers the write. The property is only present on the
CLI/Gradle run-app path, so a normally deployed application is unaffected.
Creates and returns a file change listener for notifying the plugin manager of changes.
applicationContext - - The running org.springframework.context.ApplicationContext Stashes the application source classes as a well-known singleton so that
GrailsEarlyPluginRegistrationPostProcessor can perform artefact discovery before
Spring Boot auto-configuration is processed. Runs before the context initializers are
applied, so the singleton is available by the time the early registration phase executes.
Static helper that can be used to run a GrailsApp from the specified source using default settings.
source - the source to loadargs - the application arguments (usually passed from a Java main method)Static helper that can be used to run a GrailsApp from the specified sources using default settings and user supplied arguments.
sources - the sources to loadargs - the application arguments (usually passed from a Java main method)