SpringApplicationBuilder
Builder for SpringApplication and ApplicationContext instances with convenient fluent API and context hierarchy support. Simple example of a context hierarchy:
new SpringApplicationBuilder(ParentConfig.class).child(ChildConfig.class).run(args);
Content copied to clipboard
new SpringApplicationBuilder(Application.class).profiles("server")
.properties("transport=local").run(args);
Content copied to clipboard
If your needs are simpler, consider using the static convenience methods in SpringApplication instead.
Author
Dave Syer
Andy Wilkinson
Since
1.0.0
See also
Functions
Link copied to clipboard
open fun addBootstrapRegistryInitializer(bootstrapRegistryInitializer: BootstrapRegistryInitializer): SpringApplicationBuilder
Adds BootstrapRegistryInitializer instances that can be used to initialize the BootstrapRegistry.
Link copied to clipboard
Flag to indicate that command line arguments should be added to the environment.
Link copied to clipboard
Whether to allow circular references between beans and automatically try to resolve them.
Link copied to clipboard
Accessor for the current application.
Link copied to clipboard
Configure the ApplicationStartup to be used with the ApplicationContext for collecting startup metrics.
Link copied to clipboard
Sets the Banner instance which will be used to print the banner when no static banner file is provided.
Link copied to clipboard
Link copied to clipboard
Bean name generator for automatically generated bean names in the application context.
Link copied to clipboard
Returns a fully configured SpringApplication that is ready to run.
Link copied to clipboard
Accessor for the current application context.
Link copied to clipboard
Explicitly set the factory used to create the application context.
Link copied to clipboard
Environment for the application context.
Link copied to clipboard
Prefix that should be applied when obtaining configuration properties from the system environment.
Link copied to clipboard
Sets if the application is headless and should not instantiate AWT.
Link copied to clipboard
open fun initializers(initializers: Array<ApplicationContextInitializer<out Any>>): SpringApplicationBuilder
Add some initializers to the application (applied to the ApplicationContext before any bean definitions are loaded).
Link copied to clipboard
Flag to control whether the application should be initialized lazily.
Link copied to clipboard
Add some listeners to the application (listening for SpringApplication events as well as regular Spring events once the context is running).
Link copied to clipboard
Flag to indicate the startup information should be logged.
Link copied to clipboard
Fixes the main application class that is used to anchor the startup messages.
Link copied to clipboard
Add a parent application with the provided sources.
Add an already running parent context to an existing application.
Link copied to clipboard
Add to the active Spring profiles for this app (and its parent and children).
Link copied to clipboard
Default properties for the environment in the form
key=value
or key:value
.Default properties for the environment.
Default properties for the environment.Multiple calls to this method are cumulative and will not clear any previously set properties.
Link copied to clipboard
Sets if the created ApplicationContext should have a shutdown hook registered.
Link copied to clipboard
ResourceLoader for the application context.
Link copied to clipboard
Create an application context (and its parent if specified) with the command line args provided.
Link copied to clipboard
Flag to indicate if the ApplicationConversionService should be added to the application context's Environment.
Link copied to clipboard
Flag to explicitly request a specific type of web application.