Class PythonRuntimeBootstrapConfigurer
- All Implemented Interfaces:
ApplicationContextConfigurer, Ordered
@Context GraalPy context bean is initialized can create that bean on demand.
Type converters are created before the eager beans, and the beans of processOnStartup
executable methods (message listeners, scheduled jobs, ...) are instantiated by their processors
before the eager beans too. A Python bean created that early needs the runtime; with the context
recorded here, PythonContextRuntime creates the GraalPy context bean of this application
instead of failing because the bean does not exist yet. The record is cleared when the application
context shuts down (see PythonRuntimeBootstrapShutdownListener).
The bootstrap context of an application (see BootstrapContextAccess) runs the configurer
too but is never recorded: it only holds BootstrapContextCompatible beans, so it cannot
provide the GraalPy context bean, and it publishes no ShutdownEvent that would clear the
record again, which matters when a refresh recreates it while the application is running.
- Since:
- 5.3.0
- Author:
- Micronaut Team
-
Field Summary
Fields inherited from interface ApplicationContextConfigurer
NO_OPFields inherited from interface Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(ApplicationContext applicationContext) Configures the application context.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ApplicationContextConfigurer
configure
-
Constructor Details
-
PythonRuntimeBootstrapConfigurer
public PythonRuntimeBootstrapConfigurer()
-
-
Method Details
-
configure
Description copied from interface:ApplicationContextConfigurerConfigures the application context.This method will be called after the context is fully configured but prior to starting the context.
- Specified by:
configurein interfaceApplicationContextConfigurer- Parameters:
applicationContext- The context.
-