@UsesSunHttpServer open class SimpleHttpServerFactoryBean : FactoryBean<HttpServer>, InitializingBean, DisposableBean
org.springframework.beans.factory.FactoryBean that creates a simple HTTP server, based on the HTTP server that is included in Sun's JRE 1.6. Starts the HTTP server on initialization and stops it on destruction. Exposes the resulting com.sun.net.httpserver.HttpServer object.
Allows for registering com.sun.net.httpserver.HttpHandler for specific context paths. Alternatively, register such context-specific handlers programmatically on the com.sun.net.httpserver.HttpServer itself.
Author
Juergen Hoeller
Author
Arjen Poutsma
Since
2.5.1
See Also
#setPort#setContexts
SimpleHttpServerFactoryBean()
org.springframework.beans.factory.FactoryBean that creates a simple HTTP server, based on the HTTP server that is included in Sun's JRE 1.6. Starts the HTTP server on initialization and stops it on destruction. Exposes the resulting com.sun.net.httpserver.HttpServer object. Allows for registering com.sun.net.httpserver.HttpHandler for specific |
open fun afterPropertiesSet(): Unit |
|
open fun destroy(): Unit |
|
open fun getObject(): HttpServer |
|
open fun getObjectType(): Class<out HttpServer> |
|
open fun isSingleton(): Boolean |
|
open fun setAuthenticator(authenticator: Authenticator): Unit
Register a common com.sun.net.httpserver.Authenticator to be applied to all locally registered |
|
open fun setBacklog(backlog: Int): Unit
Specify the HTTP server's TCP backlog. Default is -1, indicating the system's default value. |
|
open fun setContexts(contexts: MutableMap<String, HttpHandler>): Unit
Register com.sun.net.httpserver.HttpHandler for specific context paths. |
|
open fun setExecutor(executor: Executor): Unit
Set the JDK concurrent executor to use for dispatching incoming requests. |
|
open fun setFilters(filters: MutableList<Filter>): Unit
Register common com.sun.net.httpserver.Filter to be applied to all locally registered |
|
open fun setHostname(hostname: String): Unit
Specify the HTTP server's hostname to bind to. Default is localhost; can be overridden with a specific network address to bind to. |
|
open fun setPort(port: Int): Unit
Specify the HTTP server's port. Default is 8080. |
|
open fun setShutdownDelay(shutdownDelay: Int): Unit
Specify the number of seconds to wait until HTTP exchanges have completed when shutting down the HTTP server. Default is 0. |