public class GrailsBootstrapRegistryInitializer extends java.lang.Object implements BootstrapRegistryInitializer
Registers the PluginDiscovery in the Spring Boot Bootstrap context so it can be accessed during the early lifecycle of the application & later promoted to actual bean.
This ensures that both the early-lifecycle GrailsEnvironmentPostProcessor and the later-lifecycle DefaultGrailsPluginManager can access the same discovered, filtered, and sorted set of plugins.
Also resolves the configured StackTraceFilterer from the environment and installs it in
GrailsUtil before the ApplicationContext refreshes, then promotes the same instance
as an ApplicationContext singleton bean. Doing this here — rather than from a bean's setter,
such as GrailsExceptionResolver.setGrailsApplication() — means every app type is covered
(not just apps that wire an exception resolver), and a startup failure honours the configured
filterer too.
This class is registered via META-INF/spring.factories under the
org.springframework.boot.bootstrap.BootstrapRegistryInitializer key.
| Modifiers | Name | Description |
|---|---|---|
static java.lang.String |
STACK_TRACE_FILTERER_BEAN_NAME |
Name under which the config-resolved StackTraceFilterer is promoted as an
ApplicationContext singleton bean, so later-lifecycle consumers (e.g.
|
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
initialize(BootstrapRegistry registry) |
| 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) |
Name under which the config-resolved StackTraceFilterer is promoted as an
ApplicationContext singleton bean, so later-lifecycle consumers (e.g.
GrailsExceptionResolver) reuse that instance instead of instantiating a second copy
from config. Declared here — next to the code that registers the bean — for the same reason
PluginDiscovery.BEAN_NAME is.
An application that registers its own bean definition under this name replaces the
promoted singleton in the context, but not the instance already installed in
GrailsUtil; see GrailsExceptionResolver.resolvePromotedStackTraceFilterer().