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 Summary
ConstructorsConstructorDescriptionCreate a newAbstractConfigurableWebServerFactoryinstance.AbstractConfigurableWebServerFactory(int port) Create a newAbstractConfigurableWebServerFactoryinstance with the specified port. -
Method Summary
Modifier 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()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.
-
Constructor Details
-
AbstractConfigurableWebServerFactory
public AbstractConfigurableWebServerFactory()Create a newAbstractConfigurableWebServerFactoryinstance. -
AbstractConfigurableWebServerFactory
public AbstractConfigurableWebServerFactory(int port) Create a newAbstractConfigurableWebServerFactoryinstance with the specified port.- Parameters:
port- the port number for the web server
-
-
Method Details
-
getPort
public int getPort()The port that the web server listens on.- Returns:
- the port
-
setPort
public 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 interfaceConfigurableWebServerFactory- Parameters:
port- the port to set
-
getAddress
Return the address that the web server binds to.- Returns:
- the address
-
setAddress
Description copied from interface:ConfigurableWebServerFactorySets the specific network address that the server should bind to.- Specified by:
setAddressin interfaceConfigurableWebServerFactory- Parameters:
address- the address to set (defaults tonull)
-
getErrorPages
Returns a mutable set ofErrorPagesthat will be used when handling exceptions.- Returns:
- the error pages
-
setErrorPages
Description copied from interface:ConfigurableWebServerFactorySets the error pages that will be used when handling exceptions.- Specified by:
setErrorPagesin interfaceConfigurableWebServerFactory- Parameters:
errorPages- the error pages
-
addErrorPages
Description copied from interface:ErrorPageRegistryAdds error pages that will be used when handling exceptions.- Specified by:
addErrorPagesin interfaceErrorPageRegistry- Parameters:
errorPages- the error pages
-
getSsl
-
setSsl
Description copied from interface:ConfigurableWebServerFactorySets the SSL configuration that will be applied to the server's default connector.- Specified by:
setSslin interfaceConfigurableWebServerFactory- Parameters:
ssl- the SSL configuration
-
getSslBundles
Return the configuredSslBundles.- Returns:
- the
SslBundlesornull - Since:
- 3.2.0
-
setSslBundles
Description copied from interface:ConfigurableWebServerFactorySets the SSL bundles that can be used to configure SSL connections.- Specified by:
setSslBundlesin interfaceConfigurableWebServerFactory- Parameters:
sslBundles- the SSL bundles
-
getHttp2
-
setHttp2
Description copied from interface:ConfigurableWebServerFactorySets the HTTP/2 configuration that will be applied to the server.- Specified by:
setHttp2in interfaceConfigurableWebServerFactory- Parameters:
http2- the HTTP/2 configuration
-
getCompression
-
setCompression
Description copied from interface:ConfigurableWebServerFactorySets the compression configuration that will be applied to the server's default connector.- Specified by:
setCompressionin interfaceConfigurableWebServerFactory- Parameters:
compression- the compression configuration
-
getServerHeader
-
setServerHeader
Description copied from interface:ConfigurableWebServerFactorySets the server header value.- Specified by:
setServerHeaderin interfaceConfigurableWebServerFactory- Parameters:
serverHeader- the server header value
-
setShutdown
Description copied from interface:ConfigurableWebServerFactorySets the shutdown configuration that will be applied to the server.- Specified by:
setShutdownin interfaceConfigurableWebServerFactory- Parameters:
shutdown- the shutdown configuration
-
getShutdown
Returns the shutdown configuration that will be applied to the server.- Returns:
- the shutdown configuration
- Since:
- 2.3.0
-
getSslBundle
Return theSslBundlethat should be used with this server.- Returns:
- the SSL bundle
-
getServerNameSslBundles
-
createTempDir
Return the absolute temp dir for given web server.- Parameters:
prefix- server name- Returns:
- the temp dir for given server.
-