allow subclassing of SpringApplicationBuilder
This commit is contained in:
parent
021f8eba03
commit
514dad6d22
|
|
@ -80,10 +80,21 @@ public class SpringApplicationBuilder {
|
||||||
private boolean registerShutdownHookApplied;
|
private boolean registerShutdownHookApplied;
|
||||||
|
|
||||||
public SpringApplicationBuilder(Object... sources) {
|
public SpringApplicationBuilder(Object... sources) {
|
||||||
this.application = new SpringApplication(sources);
|
this.application = createSpringApplication(sources);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Creates a new {@link org.springframework.boot.SpringApplication} instances from the given sources. Subclasses may
|
||||||
|
* override in order to provide a custom subclass of {@link org.springframework.boot.SpringApplication}
|
||||||
|
*
|
||||||
|
* @param sources The sources
|
||||||
|
* @return The {@link org.springframework.boot.SpringApplication} instance
|
||||||
|
*/
|
||||||
|
protected SpringApplication createSpringApplication(Object... sources) {
|
||||||
|
return new SpringApplication(sources);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
* Accessor for the current application context.
|
* Accessor for the current application context.
|
||||||
* @return the current application context (or null if not yet running)
|
* @return the current application context (or null if not yet running)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue