diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java index 20a34d020eb3..b6ad684d5f52 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java @@ -298,6 +298,15 @@ public int getPort() { return ports.get(0).getNumber(); } + /** + * Returns the undertow of the WebServer. Note, the return value will be null until + * the server has been started. + * @return undertow of the WebServer. + */ + public Undertow getUndertow() { + return this.undertow; + } + @Override public void shutDownGracefully(GracefulShutdownCallback callback) { if (this.gracefulShutdown == null) {