Class TomcatSettings.Builder
- Enclosing class:
- TomcatSettings
TomcatSettings.-
Method Summary
Modifier and TypeMethodDescriptionSpecifies the Catalina base directory used by the embedded Tomcat server for its work files.build()Builds a newTomcatSettingsfrom this builder.ports(int... value) Specifies the ports to try when binding the Tomcat server.shutdownSettleDelay(Duration value) Specifies the settle delay applied between flipping the readiness probe out of service and stopping the connector.stopTimeout(Duration value) Specifies the bounded graceful-shutdown drain timeout for the Tomcat server.
-
Method Details
-
build
Builds a newTomcatSettingsfrom this builder.- Returns:
- A new settings instance.
-
ports
Specifies the ports to try when binding the Tomcat server.The first available port is used. A value of
0 indicates "try a random port". When set, this value takes precedence over theTomcat/port config-file entry and theTomcat-Port manifest entry.- Parameters:
value- The candidate ports, in priority order. Can benull to defer to config / manifest.- Returns:
- This object.
-
baseDir
Specifies the Catalina base directory used by the embedded Tomcat server for its work files.When set, the
TomcatServerFactoryuses this directory as both the Catalina base and the root context doc-base, and the directory is left in place after the server stops. When not set, theTomcatServerComponentcreates a fresh temp directory on start-up and deletes it on stop.- Parameters:
value- The absolute or relative path to the base directory. Can benull to use an auto-created temp directory.- Returns:
- This object.
-
stopTimeout
Specifies the bounded graceful-shutdown drain timeout for the Tomcat server.On stop, the connector is paused (stops accepting new requests) and the component waits up to this duration for in-flight requests to complete before the server stops. When set, this value takes precedence over the
Tomcat/stopTimeout config-file entry (in milliseconds). When neither is set, a default of30sis applied.- Parameters:
value- The drain timeout. Can benull to defer to config, then to the default.- Returns:
- This object.
-
shutdownSettleDelay
Specifies the settle delay applied between flipping the readiness probe out of service and stopping the connector.On stop, the readiness probe (
/readyz) flips to503before the connector is paused so a load balancer / Kubernetes stops routing new traffic. This brief delay gives the load balancer time to observe the503before in-flight requests are drained. When set, this value takes precedence over theTomcat/shutdownSettleDelay config-file entry (in milliseconds). When neither is set, no settle delay is applied (defaults to0) — the recommended Kubernetes pattern is apreStophook sleep instead.- Parameters:
value- The settle delay. Can benull to defer to config, then to the default.- Returns:
- This object.
-