-
Notifications
You must be signed in to change notification settings - Fork 41.3k
Description
Auto-start was introduced before 1.0. The intent appears to have been to prevent the server from starting. At the time it was when the port was set to 0. It's now when the port is set to a negative value. ServletContextAware
is also mentioned which suggests that such components should still be called with the current ServletContext
.
I think the name autoStart
is misleading. It doesn't control whether the web server will be started automatically, but what start will do. Put another way, calling start()
on a web server with auto-start disabled does not put it in the same state as one that was created with auto-start enabled.
We have four web servers now, and various behaviors when auto-start is disabled:
WebServer | Auto-start disabled behavior |
---|---|
NettyWebServer |
No auto-start support |
JettyWebServer |
Server isn't started at all |
TomcatWebServer |
Tomcat is started but the connector's protocol handler is stopped |
UndertowWebServer |
Undertow instance isn't even created |
With the opportunity that 4.0 provides for breaking changes, we should review the auto-start behavior. Given the inconsistency of the current implementations we should consider if the feature's needed at all. It also doesn't appear to be documented so it perhaps isn't widely used. If we want to keep it, we should, if possible, offer consistent behavior across all web servers. We should also consider renaming it.