ApplicationContextRunner

An ApplicationContext runner for a standard, non-web environment ConfigurableApplicationContext.

See AbstractApplicationContextRunner for details.

Author

Stephane Nicoll

Andy Wilkinson

Phillip Webb

Since

2.0.0

Constructors

Link copied to clipboard
constructor()
Create a new ApplicationContextRunner instance using an AnnotationConfigApplicationContext as the underlying source.
constructor(contextFactory: Supplier<ConfigurableApplicationContext>)
Create a new ApplicationContextRunner instance using the specified contextFactory as the underlying source.
constructor(contextFactory: Supplier<ConfigurableApplicationContext>, additionalContextInterfaces: Array<Class<out Any>>)
Create a new ApplicationContextRunner instance using the specified contextFactory as the underlying source.

Functions

Link copied to clipboard
open fun prepare(consumer: ContextConsumer<in A>): SELF
Prepare a new ApplicationContext based on the current state of this loader.
Link copied to clipboard
open fun run(consumer: ContextConsumer<in A>): SELF
Create and refresh a new ApplicationContext based on the current state of this loader.
Link copied to clipboard
open fun with(customizer: (SELF) -> SELF): SELF
Apply customization to this runner.
Link copied to clipboard
open fun withAllowBeanDefinitionOverriding(allowBeanDefinitionOverriding: Boolean): SELF
Specify if bean definition overriding, by registering a definition with the same name as an existing definition, should be allowed.
Link copied to clipboard
open fun withAllowCircularReferences(allowCircularReferences: Boolean): SELF
Specify if circular references between beans should be allowed.
Link copied to clipboard
open fun <T> withBean(type: Class<T>, constructorArgs: Array<Any>): SELF
open fun <T> withBean(type: Class<T>, supplier: Supplier<T>, customizers: Array<BeanDefinitionCustomizer>): SELF
open fun <T> withBean(name: String, type: Class<T>, constructorArgs: Array<Any>): SELF
open fun <T> withBean(name: String, type: Class<T>, supplier: Supplier<T>, customizers: Array<BeanDefinitionCustomizer>): SELF
Register the specified user bean with the ApplicationContext.
Link copied to clipboard
open fun withClassLoader(classLoader: ClassLoader): SELF
Customize the ClassLoader that the ApplicationContext should use for resource loading and bean class loading.
Link copied to clipboard
open fun withConfiguration(configurations: Configurations): SELF
Register the specified configuration classes with the ApplicationContext.
Link copied to clipboard
Add an ApplicationContextInitializer to be called when the context is created.
Link copied to clipboard
Configure the parent of the ApplicationContext.
Link copied to clipboard
open fun withPropertyValues(pairs: Array<String>): SELF
Add the specified Environment property pairs.
Link copied to clipboard
Add the specified System property pairs.
Link copied to clipboard
open fun withUserConfiguration(configurationClasses: Array<Class<out Any>>): SELF
Register the specified user configuration classes with the ApplicationContext.