public class JettyReactiveWebServerFactory extends AbstractReactiveWebServerFactory
ReactiveWebServerFactory
that can be used to create JettyWebServer
s.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
JettyServerCustomizer s 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
JettyServerCustomizer s 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
JettyServerCustomizer s 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, getHttp2, getPort, getServerHeader, getSsl, getSslStoreProvider, setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setSsl, setSslStoreProvider
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setSsl, setSslStoreProvider
addErrorPages
public 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)
ReactiveWebServerFactory
WebServer
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 requestsWebServer
WebServer.stop()
protected Server createJettyServer(org.springframework.http.server.reactive.JettyHttpHandlerAdapter servlet)
public ThreadPool getThreadPool()
ThreadPool
that should be used by the Server
.ThreadPool
or null
public 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)
JettyServerCustomizer
s 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()
JettyServerCustomizer
s that will be
applied to the Server
before it is created.public void addServerCustomizers(JettyServerCustomizer... customizers)
JettyServerCustomizer
s 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.