Skip to content

Commit 34b1de6

Browse files
mbensonwilkinsona
authored andcommitted
Add mainApplicationClass accessor to SpringApplication
Closes gh-4801
1 parent 0366900 commit 34b1de6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spring-boot/src/main/java/org/springframework/boot/SpringApplication.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,14 @@ private boolean isMainThread(Thread currentThread) {
914914
&& "main".equals(currentThread.getThreadGroup().getName());
915915
}
916916

917+
/**
918+
* Returns the main application class that has been deduced or explicitly configured.
919+
* @return the main application class or {@code null}
920+
*/
921+
public Class<?> getMainApplicationClass() {
922+
return this.mainApplicationClass;
923+
}
924+
917925
/**
918926
* Set a specific main application class that will be used as a log source and to
919927
* obtain version information. By default the main application class will be deduced.

0 commit comments

Comments
 (0)