Class AbstractConfigurableWebServerFactory
java.lang.Object
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
- All Implemented Interfaces:
- ConfigurableWebServerFactory,- ErrorPageRegistry,- WebServerFactory
- Direct Known Subclasses:
- AbstractReactiveWebServerFactory,- AbstractServletWebServerFactory
public abstract class AbstractConfigurableWebServerFactory
extends Object
implements ConfigurableWebServerFactory
Abstract base class for 
ConfigurableWebServerFactory implementations.- Since:
- 2.0.0
- Author:
- Phillip Webb, Dave Syer, Andy Wilkinson, Stephane Nicoll, Ivan Sopov, EddĂș MelĂ©ndez, Brian Clozel, Scott Frederick
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a newAbstractConfigurableWebServerFactoryinstance.AbstractConfigurableWebServerFactory(int port) Create a newAbstractConfigurableWebServerFactoryinstance with the specified port.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddErrorPages(ErrorPage... errorPages) Adds error pages that will be used when handling exceptions.protected final FilecreateTempDir(String prefix) Return the absolute temp dir for given web server.Return the address that the web server binds to.Returns a mutable set ofErrorPagesthat will be used when handling exceptions.getHttp2()final SslStoreProviderDeprecated, for removal: This API element is subject to removal in a future version.intgetPort()The port that the web server listens on.Returns the shutdown configuration that will be applied to the server.getSsl()protected final SslBundleReturn theSslBundlethat should be used with this server.Return the configuredSslBundles.voidsetAddress(InetAddress address) Sets the specific network address that the server should bind to.voidsetCompression(Compression compression) Sets the compression configuration that will be applied to the server's default connector.voidsetErrorPages(Set<? extends ErrorPage> errorPages) Sets the error pages that will be used when handling exceptions.voidSets the HTTP/2 configuration that will be applied to the server.voidsetPort(int port) Sets the port that the web server should listen on.voidsetServerHeader(String serverHeader) Sets the server header value.voidsetShutdown(Shutdown shutdown) Sets the shutdown configuration that will be applied to the server.voidSets the SSL configuration that will be applied to the server's default connector.voidsetSslBundles(SslBundles sslBundles) Sets the SSL bundles that can be used to configure SSL connections.voidsetSslStoreProvider(SslStoreProvider sslStoreProvider) Sets a provider that will be used to obtain SSL stores.
- 
Constructor Details- 
AbstractConfigurableWebServerFactorypublic AbstractConfigurableWebServerFactory()Create a newAbstractConfigurableWebServerFactoryinstance.
- 
AbstractConfigurableWebServerFactorypublic AbstractConfigurableWebServerFactory(int port) Create a newAbstractConfigurableWebServerFactoryinstance with the specified port.- Parameters:
- port- the port number for the web server
 
 
- 
- 
Method Details- 
getPortpublic int getPort()The port that the web server listens on.- Returns:
- the port
 
- 
setPortpublic void setPort(int port) Description copied from interface:ConfigurableWebServerFactorySets the port that the web server should listen on. If not specified port '8080' will be used. Use port -1 to disable auto-start (i.e. start the web application context but not have it listen to any port).- Specified by:
- setPortin interface- ConfigurableWebServerFactory
- Parameters:
- port- the port to set
 
- 
getAddressReturn the address that the web server binds to.- Returns:
- the address
 
- 
setAddressDescription copied from interface:ConfigurableWebServerFactorySets the specific network address that the server should bind to.- Specified by:
- setAddressin interface- ConfigurableWebServerFactory
- Parameters:
- address- the address to set (defaults to- null)
 
- 
getErrorPagesReturns a mutable set ofErrorPagesthat will be used when handling exceptions.- Returns:
- the error pages
 
- 
setErrorPagesDescription copied from interface:ConfigurableWebServerFactorySets the error pages that will be used when handling exceptions.- Specified by:
- setErrorPagesin interface- ConfigurableWebServerFactory
- Parameters:
- errorPages- the error pages
 
- 
addErrorPagesDescription copied from interface:ErrorPageRegistryAdds error pages that will be used when handling exceptions.- Specified by:
- addErrorPagesin interface- ErrorPageRegistry
- Parameters:
- errorPages- the error pages
 
- 
getSsl
- 
setSslDescription copied from interface:ConfigurableWebServerFactorySets the SSL configuration that will be applied to the server's default connector.- Specified by:
- setSslin interface- ConfigurableWebServerFactory
- Parameters:
- ssl- the SSL configuration
 
- 
getSslStoreProvider
- 
setSslStoreProviderDescription copied from interface:ConfigurableWebServerFactorySets a provider that will be used to obtain SSL stores.- Specified by:
- setSslStoreProviderin interface- ConfigurableWebServerFactory
- Parameters:
- sslStoreProvider- the SSL store provider
 
- 
getSslBundlesReturn the configuredSslBundles.- Returns:
- the SslBundlesornull
- Since:
- 3.2.0
 
- 
setSslBundlesDescription copied from interface:ConfigurableWebServerFactorySets the SSL bundles that can be used to configure SSL connections.- Specified by:
- setSslBundlesin interface- ConfigurableWebServerFactory
- Parameters:
- sslBundles- the SSL bundles
 
- 
getHttp2
- 
setHttp2Description copied from interface:ConfigurableWebServerFactorySets the HTTP/2 configuration that will be applied to the server.- Specified by:
- setHttp2in interface- ConfigurableWebServerFactory
- Parameters:
- http2- the HTTP/2 configuration
 
- 
getCompression
- 
setCompressionDescription copied from interface:ConfigurableWebServerFactorySets the compression configuration that will be applied to the server's default connector.- Specified by:
- setCompressionin interface- ConfigurableWebServerFactory
- Parameters:
- compression- the compression configuration
 
- 
getServerHeader
- 
setServerHeaderDescription copied from interface:ConfigurableWebServerFactorySets the server header value.- Specified by:
- setServerHeaderin interface- ConfigurableWebServerFactory
- Parameters:
- serverHeader- the server header value
 
- 
setShutdownDescription copied from interface:ConfigurableWebServerFactorySets the shutdown configuration that will be applied to the server.- Specified by:
- setShutdownin interface- ConfigurableWebServerFactory
- Parameters:
- shutdown- the shutdown configuration
 
- 
getShutdownReturns the shutdown configuration that will be applied to the server.- Returns:
- the shutdown configuration
- Since:
- 2.3.0
 
- 
getOrCreateSslStoreProvider@Deprecated(since="3.1.0", forRemoval=true) public final SslStoreProvider getOrCreateSslStoreProvider()Deprecated, for removal: This API element is subject to removal in a future version.since 3.1.0 for removal in 3.3.0 in favor ofgetSslBundle()Return the providedSslStoreProvideror create one usingSslproperties.- Returns:
- the SslStoreProvider
 
- 
getSslBundleReturn theSslBundlethat should be used with this server.- Returns:
- the SSL bundle
 
- 
createTempDirReturn the absolute temp dir for given web server.- Parameters:
- prefix- server name
- Returns:
- the temp dir for given server.
 
 
- 
getSslBundle()