Class JettyReactiveWebServerFactory
java.lang.Object
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
org.springframework.boot.web.reactive.server.AbstractReactiveWebServerFactory
org.springframework.boot.web.embedded.jetty.JettyReactiveWebServerFactory
- All Implemented Interfaces:
- ConfigurableJettyWebServerFactory,- ConfigurableReactiveWebServerFactory,- ReactiveWebServerFactory,- ConfigurableWebServerFactory,- ErrorPageRegistry,- WebServerFactory
public class JettyReactiveWebServerFactory
extends AbstractReactiveWebServerFactory
implements ConfigurableJettyWebServerFactory
ReactiveWebServerFactory that can be used to create JettyWebServers.- Since:
- 2.0.0
- Author:
- Brian Clozel, Moritz Halbritter
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a newJettyServletWebServerFactoryinstance.JettyReactiveWebServerFactory(int port) Create a newJettyServletWebServerFactorythat listens for requests using the specified port.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddServerCustomizers(JettyServerCustomizer... customizers) AddJettyServerCustomizers that will be applied to theServerbefore it is started.protected org.eclipse.jetty.server.ServercreateJettyServer(JettyHttpHandlerAdapter servlet) protected JettyResourceFactoryReturns a mutable collection of JettyJettyServerCustomizers that will be applied to theServerbefore it is created.org.eclipse.jetty.util.thread.ThreadPoolReturns a JettyThreadPoolthat should be used by theServer.getWebServer(HttpHandler httpHandler) Gets a new fully configured but pausedWebServerinstance.voidsetAcceptors(int acceptors) Set the number of acceptor threads to use.voidsetMaxConnections(int maxConnections) Sets the maximum number of concurrent connections.voidsetResourceFactory(JettyResourceFactory resourceFactory) Set theJettyResourceFactoryto get the shared resources from.voidsetSelectors(int selectors) Set the number of selector threads to use.voidsetServerCustomizers(Collection<? extends JettyServerCustomizer> customizers) SetsJettyServerCustomizers that will be applied to theServerbefore it is started.voidsetThreadPool(org.eclipse.jetty.util.thread.ThreadPool threadPool) Set theThreadPoolthat should be used by theServer.voidsetUseForwardHeaders(boolean useForwardHeaders) Set if x-forward-* headers should be processed.Methods inherited from class org.springframework.boot.web.server.AbstractConfigurableWebServerFactoryaddErrorPages, createTempDir, getAddress, getCompression, getErrorPages, getHttp2, getPort, getServerHeader, getServerNameSslBundles, getShutdown, getSsl, getSslBundle, getSslBundles, setAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setShutdown, setSsl, setSslBundlesMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.boot.web.server.ConfigurableWebServerFactorysetAddress, setCompression, setErrorPages, setHttp2, setPort, setServerHeader, setShutdown, setSsl, setSslBundlesMethods inherited from interface org.springframework.boot.web.server.ErrorPageRegistryaddErrorPages
- 
Constructor Details- 
JettyReactiveWebServerFactorypublic JettyReactiveWebServerFactory()Create a newJettyServletWebServerFactoryinstance.
- 
JettyReactiveWebServerFactorypublic JettyReactiveWebServerFactory(int port) Create a newJettyServletWebServerFactorythat listens for requests using the specified port.- Parameters:
- port- the port to listen on
 
 
- 
- 
Method Details- 
setUseForwardHeaderspublic void setUseForwardHeaders(boolean useForwardHeaders) Description copied from interface:ConfigurableJettyWebServerFactorySet if x-forward-* headers should be processed.- Specified by:
- setUseForwardHeadersin interface- ConfigurableJettyWebServerFactory
- Parameters:
- useForwardHeaders- if x-forward headers should be used
 
- 
setAcceptorspublic void setAcceptors(int acceptors) Description copied from interface:ConfigurableJettyWebServerFactorySet the number of acceptor threads to use.- Specified by:
- setAcceptorsin interface- ConfigurableJettyWebServerFactory
- Parameters:
- acceptors- the number of acceptor threads to use
 
- 
getWebServerDescription copied from interface:ReactiveWebServerFactoryGets a new fully configured but pausedWebServerinstance. Clients should not be able to connect to the returned server untilWebServer.start()is called (which happens when theApplicationContexthas been fully refreshed).- Specified by:
- getWebServerin interface- ReactiveWebServerFactory
- Parameters:
- httpHandler- the HTTP handler in charge of processing requests
- Returns:
- a fully configured and started WebServer
- See Also:
 
- 
addServerCustomizersDescription copied from interface:ConfigurableJettyWebServerFactoryAddJettyServerCustomizers that will be applied to theServerbefore it is started.- Specified by:
- addServerCustomizersin interface- ConfigurableJettyWebServerFactory
- Parameters:
- customizers- the customizers to add
 
- 
setMaxConnectionspublic void setMaxConnections(int maxConnections) Description copied from interface:ConfigurableJettyWebServerFactorySets the maximum number of concurrent connections.- Specified by:
- setMaxConnectionsin interface- ConfigurableJettyWebServerFactory
- Parameters:
- maxConnections- the maximum number of concurrent connections
 
- 
setServerCustomizersSetsJettyServerCustomizers that will be applied to theServerbefore it is started. Calling this method will replace any existing customizers.- Parameters:
- customizers- the Jetty customizers to apply
 
- 
getServerCustomizersReturns a mutable collection of JettyJettyServerCustomizers that will be applied to theServerbefore it is created.- Returns:
- the Jetty customizers
 
- 
getThreadPoolpublic org.eclipse.jetty.util.thread.ThreadPool getThreadPool()Returns a JettyThreadPoolthat should be used by theServer.- Returns:
- a Jetty ThreadPoolornull
 
- 
setThreadPoolpublic void setThreadPool(org.eclipse.jetty.util.thread.ThreadPool threadPool) Description copied from interface:ConfigurableJettyWebServerFactorySet theThreadPoolthat should be used by theServer. If set tonull(default), theServercreates aThreadPoolimplicitly.- Specified by:
- setThreadPoolin interface- ConfigurableJettyWebServerFactory
- Parameters:
- threadPool- the ThreadPool to be used
 
- 
setSelectorspublic void setSelectors(int selectors) Description copied from interface:ConfigurableJettyWebServerFactorySet the number of selector threads to use.- Specified by:
- setSelectorsin interface- ConfigurableJettyWebServerFactory
- Parameters:
- selectors- the number of selector threads to use
 
- 
setResourceFactorySet theJettyResourceFactoryto get the shared resources from.- Parameters:
- resourceFactory- the server resources
- Since:
- 2.1.0
 
- 
getResourceFactory
- 
createJettyServer
 
-