public class JettyReactiveWebServerFactory extends AbstractReactiveWebServerFactory
ReactiveWebServerFactory that can be used to create JettyWebServers.| Constructor and Description |
|---|
JettyReactiveWebServerFactory()
Create a new
JettyServletWebServerFactory instance. |
JettyReactiveWebServerFactory(int port)
Create a new
JettyServletWebServerFactory that listens for requests using
the specified port. |
| Modifier and Type | Method and Description |
|---|---|
void |
addServerCustomizers(JettyServerCustomizer... customizers)
Add
JettyServerCustomizers that will be applied to the Server
before it is started. |
protected Server |
createJettyServer(org.springframework.http.server.reactive.JettyHttpHandlerAdapter servlet) |
Collection<JettyServerCustomizer> |
getServerCustomizers()
Returns a mutable collection of Jetty
JettyServerCustomizers that will be
applied to the Server before it is created. |
ThreadPool |
getThreadPool()
Returns a Jetty
ThreadPool that should be used by the Server. |
WebServer |
getWebServer(org.springframework.http.server.reactive.HttpHandler httpHandler)
Gets a new fully configured but paused
WebServer instance. |
void |
setAcceptors(int acceptors)
Set the number of acceptor threads to use.
|
void |
setSelectors(int selectors)
Set the number of selector threads to use.
|
void |
setServerCustomizers(Collection<? extends JettyServerCustomizer> customizers)
Sets
JettyServerCustomizers that will be applied to the Server
before it is started. |
void |
setThreadPool(ThreadPool threadPool)
Set a Jetty
ThreadPool that should be used by the Server. |
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getPort, getServerHeader, getSsl, getSslStoreProvider, setAddress, setCompression, setErrorPages, setPort, setServerHeader, setSsl, setSslStoreProviderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetAddress, setCompression, setErrorPages, setPort, setServerHeader, setSsl, setSslStoreProvideraddErrorPagespublic JettyReactiveWebServerFactory()
JettyServletWebServerFactory instance.public JettyReactiveWebServerFactory(int port)
JettyServletWebServerFactory that listens for requests using
the specified port.port - the port to listen onpublic WebServer getWebServer(org.springframework.http.server.reactive.HttpHandler httpHandler)
ReactiveWebServerFactoryWebServer instance. Clients should
not be able to connect to the returned server until WebServer.start() is
called (which happens when the ApplicationContext has been fully
refreshed).httpHandler - the HTTP handler in charge of processing requestsWebServerWebServer.stop()protected Server createJettyServer(org.springframework.http.server.reactive.JettyHttpHandlerAdapter servlet)
public ThreadPool getThreadPool()
ThreadPool that should be used by the Server.ThreadPool or nullpublic void setThreadPool(ThreadPool threadPool)
ThreadPool that should be used by the Server. If set to
null (default), the Server creates a ThreadPool implicitly.threadPool - a Jetty ThreadPool to be usedpublic void setAcceptors(int acceptors)
acceptors - the number of acceptor threads to usepublic void setServerCustomizers(Collection<? extends JettyServerCustomizer> customizers)
JettyServerCustomizers that will be applied to the Server
before it is started. Calling this method will replace any existing customizers.customizers - the Jetty customizers to applypublic Collection<JettyServerCustomizer> getServerCustomizers()
JettyServerCustomizers that will be
applied to the Server before it is created.public void addServerCustomizers(JettyServerCustomizer... customizers)
JettyServerCustomizers that will be applied to the Server
before it is started.customizers - the customizers to addpublic void setSelectors(int selectors)
selectors - the number of selector threads to useCopyright © 2017 Pivotal Software, Inc.. All rights reserved.