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
ConstructorDescriptionCreate a newAbstractConfigurableWebServerFactory
instance.AbstractConfigurableWebServerFactory
(int port) Create a newAbstractConfigurableWebServerFactory
instance with the specified port. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addErrorPages
(ErrorPage... errorPages) Adds error pages that will be used when handling exceptions.protected final File
createTempDir
(String prefix) Return the absolute temp dir for given web server.Return the address that the web server binds to.Returns a mutable set ofErrorPages
that will be used when handling exceptions.getHttp2()
int
getPort()
The port that the web server listens on.Returns the shutdown configuration that will be applied to the server.getSsl()
protected final SslBundle
Return theSslBundle
that should be used with this server.Return the configuredSslBundles
.void
setAddress
(InetAddress address) Sets the specific network address that the server should bind to.void
setCompression
(Compression compression) Sets the compression configuration that will be applied to the server's default connector.void
setErrorPages
(Set<? extends ErrorPage> errorPages) Sets the error pages that will be used when handling exceptions.void
Sets the HTTP/2 configuration that will be applied to the server.void
setPort
(int port) Sets the port that the web server should listen on.void
setServerHeader
(String serverHeader) Sets the server header value.void
setShutdown
(Shutdown shutdown) Sets the shutdown configuration that will be applied to the server.void
Sets the SSL configuration that will be applied to the server's default connector.void
setSslBundles
(SslBundles sslBundles) Sets the SSL bundles that can be used to configure SSL connections.
-
Constructor Details
-
AbstractConfigurableWebServerFactory
public AbstractConfigurableWebServerFactory()Create a newAbstractConfigurableWebServerFactory
instance. -
AbstractConfigurableWebServerFactory
public AbstractConfigurableWebServerFactory(int port) Create a newAbstractConfigurableWebServerFactory
instance 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:ConfigurableWebServerFactory
Sets 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:
setPort
in 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:ConfigurableWebServerFactory
Sets the specific network address that the server should bind to.- Specified by:
setAddress
in interfaceConfigurableWebServerFactory
- Parameters:
address
- the address to set (defaults tonull
)
-
getErrorPages
Returns a mutable set ofErrorPages
that will be used when handling exceptions.- Returns:
- the error pages
-
setErrorPages
Description copied from interface:ConfigurableWebServerFactory
Sets the error pages that will be used when handling exceptions.- Specified by:
setErrorPages
in interfaceConfigurableWebServerFactory
- Parameters:
errorPages
- the error pages
-
addErrorPages
Description copied from interface:ErrorPageRegistry
Adds error pages that will be used when handling exceptions.- Specified by:
addErrorPages
in interfaceErrorPageRegistry
- Parameters:
errorPages
- the error pages
-
getSsl
-
setSsl
Description copied from interface:ConfigurableWebServerFactory
Sets the SSL configuration that will be applied to the server's default connector.- Specified by:
setSsl
in interfaceConfigurableWebServerFactory
- Parameters:
ssl
- the SSL configuration
-
getSslBundles
Return the configuredSslBundles
.- Returns:
- the
SslBundles
ornull
- Since:
- 3.2.0
-
setSslBundles
Description copied from interface:ConfigurableWebServerFactory
Sets the SSL bundles that can be used to configure SSL connections.- Specified by:
setSslBundles
in interfaceConfigurableWebServerFactory
- Parameters:
sslBundles
- the SSL bundles
-
getHttp2
-
setHttp2
Description copied from interface:ConfigurableWebServerFactory
Sets the HTTP/2 configuration that will be applied to the server.- Specified by:
setHttp2
in interfaceConfigurableWebServerFactory
- Parameters:
http2
- the HTTP/2 configuration
-
getCompression
-
setCompression
Description copied from interface:ConfigurableWebServerFactory
Sets the compression configuration that will be applied to the server's default connector.- Specified by:
setCompression
in interfaceConfigurableWebServerFactory
- Parameters:
compression
- the compression configuration
-
getServerHeader
-
setServerHeader
Description copied from interface:ConfigurableWebServerFactory
Sets the server header value.- Specified by:
setServerHeader
in interfaceConfigurableWebServerFactory
- Parameters:
serverHeader
- the server header value
-
setShutdown
Description copied from interface:ConfigurableWebServerFactory
Sets the shutdown configuration that will be applied to the server.- Specified by:
setShutdown
in 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 theSslBundle
that should be used with this server.- Returns:
- the SSL bundle
-
createTempDir
Return the absolute temp dir for given web server.- Parameters:
prefix
- server name- Returns:
- the temp dir for given server.
-