类 AbstractConfigurableWebServerFactory
- java.lang.Object
- org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
public abstract class AbstractConfigurableWebServerFactory extends Object implements ConfigurableWebServerFactory
Abstract base class forConfigurableWebServerFactory
implementations.- 从以下版本开始:
- 2.0.0
构造器概要
构造器 构造器 说明 AbstractConfigurableWebServerFactory()
Create a newAbstractConfigurableWebServerFactory
instance.AbstractConfigurableWebServerFactory(int port)
Create a newAbstractConfigurableWebServerFactory
instance with the specified port.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addErrorPages(ErrorPage... errorPages)
Adds error pages that will be used when handling exceptions.protected File
createTempDir(String prefix)
Return the absolute temp dir for given web server.InetAddress
getAddress()
Return the address that the web server binds to.Compression
getCompression()
Set<ErrorPage>
getErrorPages()
Returns a mutable set ofErrorPages
that will be used when handling exceptions.Http2
getHttp2()
int
getPort()
The port that the web server listens on.String
getServerHeader()
Ssl
getSsl()
SslStoreProvider
getSslStoreProvider()
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
setHttp2(Http2 http2)
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
setSsl(Ssl ssl)
Sets the SSL configuration that will be applied to the server's default connector.void
setSslStoreProvider(SslStoreProvider sslStoreProvider)
Sets a provider that will be used to obtain SSL stores.
构造器详细资料
AbstractConfigurableWebServerFactory
public AbstractConfigurableWebServerFactory()
Create a newAbstractConfigurableWebServerFactory
instance.
AbstractConfigurableWebServerFactory
public AbstractConfigurableWebServerFactory(int port)
Create a newAbstractConfigurableWebServerFactory
instance with the specified port.- 参数:
port
- the port number for the web server
方法详细资料
getPort
public int getPort()
The port that the web server listens on.- 返回:
- the port
setPort
public void setPort(int port)
从接口复制的说明: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).- 指定者:
setPort
在接口中ConfigurableWebServerFactory
- 参数:
port
- the port to set
getAddress
public InetAddress getAddress()
Return the address that the web server binds to.- 返回:
- the address
setAddress
public void setAddress(InetAddress address)
从接口复制的说明:ConfigurableWebServerFactory
Sets the specific network address that the server should bind to.- 指定者:
setAddress
在接口中ConfigurableWebServerFactory
- 参数:
address
- the address to set (defaults tonull
)
getErrorPages
public Set<ErrorPage> getErrorPages()
Returns a mutable set ofErrorPages
that will be used when handling exceptions.- 返回:
- the error pages
setErrorPages
public void setErrorPages(Set<? extends ErrorPage> errorPages)
从接口复制的说明:ConfigurableWebServerFactory
Sets the error pages that will be used when handling exceptions.- 指定者:
setErrorPages
在接口中ConfigurableWebServerFactory
- 参数:
errorPages
- the error pages
addErrorPages
public void addErrorPages(ErrorPage... errorPages)
从接口复制的说明:ErrorPageRegistry
Adds error pages that will be used when handling exceptions.- 指定者:
addErrorPages
在接口中ErrorPageRegistry
- 参数:
errorPages
- the error pages
setSsl
public void setSsl(Ssl ssl)
从接口复制的说明:ConfigurableWebServerFactory
Sets the SSL configuration that will be applied to the server's default connector.- 指定者:
setSsl
在接口中ConfigurableWebServerFactory
- 参数:
ssl
- the SSL configuration
getSslStoreProvider
public SslStoreProvider getSslStoreProvider()
setSslStoreProvider
public void setSslStoreProvider(SslStoreProvider sslStoreProvider)
从接口复制的说明:ConfigurableWebServerFactory
Sets a provider that will be used to obtain SSL stores.- 指定者:
setSslStoreProvider
在接口中ConfigurableWebServerFactory
- 参数:
sslStoreProvider
- the SSL store provider
setHttp2
public void server中的接口">ConfigurableWebServerFactory
- 参数:
http2
- the HTTP/2 configuration
getCompression
public Compression getCompression()
setCompression
public void setCompression(Compression compression)
从接口复制的说明:ConfigurableWebServerFactory
Sets the compression configuration that will be applied to the server's default connector.- 指定者:
setCompression
在接口中ConfigurableWebServerFactory
- 参数:
compression
- the compression configuration
getServerHeader
public String getServerHeader()
setServerHeader
public void setServerHeader(String serverHeader)
从接口复制的说明:ConfigurableWebServerFactory
Sets the server header value.- 指定者:
setServerHeader
在接口中ConfigurableWebServerFactory
- 参数:
serverHeader
- the server header value
createTempDir
protected final File createTempDir(String prefix)
Return the absolute temp dir for given web server.- 参数:
prefix
- server name- 返回:
- the temp dir for given server.