Class JettySettings.Builder
- Enclosing class:
- JettySettings
JettySettings.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newJettySettingsfrom this builder.Specifies the contents or location of thejetty.xml file used to build the Jetty server.ports(int... value) Specifies the ports to try when binding the Jetty 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 Jetty server.
-
Method Details
-
build
Builds a newJettySettingsfrom this builder.- Returns:
- A new settings instance.
-
ports
Specifies the ports to try when binding the Jetty server.The first available port is used. A value of
0 indicates "try a random port". When set, this value takes precedence over theJetty/port config-file entry and theJetty-Port manifest entry.- Parameters:
value- The candidate ports, in priority order. Can benull to defer to config / manifest.- Returns:
- This object.
-
jettyXml
Specifies the contents or location of thejetty.xml file used to build the Jetty server.When set, this value takes precedence over the
Jetty/config config-file entry and theJetty-Config manifest entry. When not set, the component falls back to those values and finally to ajetty.xml file located on the file system or classpath.- Parameters:
value- The contents or location of the file. Can be any of:String- Relative path to a file on the file system or classpath, or the raw XML content if it begins with< .File- File on the file system.Path- Path on the file system.InputStream- Raw contents as aUTF-8 encoded stream.Reader- Raw contents.
Can benull (defers to config / manifest / classpath resolution).resolveVars- Iftrue , SVL variables in the file will automatically be resolved.- Returns:
- This object.
- Throws:
IOException- Thrown by underlying stream.
-
stopTimeout
Specifies the bounded graceful-shutdown drain timeout for the Jetty server.On stop, the server stops accepting new connections and waits up to this duration for in-flight requests to complete before the connector closes (Jetty's
stopTimeout ). When set, this value takes precedence over theJetty/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 closes 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 theJetty/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.
-