public class JettyReactiveWebServerFactory extends AbstractReactiveWebServerFactory implements ConfigurableJettyWebServerFactory
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 org.eclipse.jetty.server.Server |
createJettyServer(JettyHttpHandlerAdapter servlet) |
protected JettyResourceFactory |
getResourceFactory() |
Collection<JettyServerCustomizer> |
getServerCustomizers()
Returns a mutable collection of Jetty
JettyServerCustomizer s that will be
applied to the Server before it is created. |
org.eclipse.jetty.util.thread.ThreadPool |
getThreadPool()
Returns a Jetty
ThreadPool that should be used by the Server . |
WebServer |
getWebServer(HttpHandler httpHandler)
Gets a new fully configured but paused
WebServer instance. |
void |
setAcceptors(int acceptors)
Set the number of acceptor threads to use.
|
void |
setResourceFactory(JettyResourceFactory resourceFactory)
Set the
JettyResourceFactory to get the shared resources from. |
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(org.eclipse.jetty.util.thread.ThreadPool threadPool)
Set the
ThreadPool that should be used by the Server . |
void |
setUseForwardHeaders(boolean useForwardHeaders)
Set if x-forward-* headers should be processed.
|
addErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, getOrCreateSslStoreProvider, getPort, getServerHeader, getShutdown, getSsl, getSslStoreProvider, setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setShutdown, setSsl, setSslStoreProvider
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setShutdown, 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 void setUseForwardHeaders(boolean useForwardHeaders)
ConfigurableJettyWebServerFactory
setUseForwardHeaders
in interface ConfigurableJettyWebServerFactory
useForwardHeaders
- if x-forward headers should be usedpublic void setAcceptors(int acceptors)
ConfigurableJettyWebServerFactory
setAcceptors
in interface ConfigurableJettyWebServerFactory
acceptors
- the number of acceptor threads to usepublic WebServer getWebServer(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).getWebServer
in interface ReactiveWebServerFactory
httpHandler
- the HTTP handler in charge of processing requestsWebServer
WebServer.stop()
public void addServerCustomizers(JettyServerCustomizer... customizers)
ConfigurableJettyWebServerFactory
JettyServerCustomizer
s that will be applied to the Server
before it is started.addServerCustomizers
in interface ConfigurableJettyWebServerFactory
customizers
- the customizers to addpublic 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 org.eclipse.jetty.util.thread.ThreadPool getThreadPool()
ThreadPool
that should be used by the Server
.ThreadPool
or null
public void setThreadPool(org.eclipse.jetty.util.thread.ThreadPool threadPool)
ConfigurableJettyWebServerFactory
ThreadPool
that should be used by the Server
. If set to
null
(default), the Server
creates a ThreadPool
implicitly.setThreadPool
in interface ConfigurableJettyWebServerFactory
threadPool
- the ThreadPool to be usedpublic void setSelectors(int selectors)
ConfigurableJettyWebServerFactory
setSelectors
in interface ConfigurableJettyWebServerFactory
selectors
- the number of selector threads to usepublic void setResourceFactory(JettyResourceFactory resourceFactory)
JettyResourceFactory
to get the shared resources from.resourceFactory
- the server resourcesprotected JettyResourceFactory getResourceFactory()
protected org.eclipse.jetty.server.Server createJettyServer(JettyHttpHandlerAdapter servlet)