类 Netty4ClientHttpRequestFactory
- java.lang.Object
- org.springframework.http.client.Netty4ClientHttpRequestFactory
@Deprecated public class Netty4ClientHttpRequestFactory extends Object implements ClientHttpRequestFactory, AsyncClientHttpRequestFactory, InitializingBean, DisposableBean
已过时。as of Spring 5.0, in favor ofReactorClientHttpConnector
ClientHttpRequestFactory
implementation that uses Netty 4 to create requests.Allows to use a pre-configured
EventLoopGroup
instance: useful for sharing across multiple clients.Note that this implementation consistently closes the HTTP connection on each request.
- 从以下版本开始:
- 4.1.2
- 作者:
- Arjen Poutsma, Rossen Stoyanchev, Brian Clozel, Mark Paluch
字段概要
字段 修饰符和类型 字段 说明 static int
DEFAULT_MAX_RESPONSE_SIZE
已过时。The default maximum response size.
构造器概要
构造器 构造器 说明 Netty4ClientHttpRequestFactory()
已过时。Create a newNetty4ClientHttpRequestFactory
with a defaultNioEventLoopGroup
.Netty4ClientHttpRequestFactory(io.netty.channel.EventLoopGroup eventLoopGroup)
已过时。Create a newNetty4ClientHttpRequestFactory
with the givenEventLoopGroup
.
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
已过时。Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.protected void
configureChannel(io.netty.channel.socket.SocketChannelConfig config)
已过时。Template method for changing properties on the givenSocketChannelConfig
.AsyncClientHttpRequest
createAsyncRequest(URI uri, HttpMethod httpMethod)
已过时。Create a new asynchronousAsyncClientHttpRequest
for the specified URI and HTTP method.ClientHttpRequest
createRequest(URI uri, HttpMethod httpMethod)
已过时。Create a newClientHttpRequest
for the specified URI and HTTP method.void
destroy()
已过时。Invoked by the containingBeanFactory
on destruction of a bean.void
setConnectTimeout(int connectTimeout)
已过时。Set the underlying connect timeout (in milliseconds).void
setMaxResponseSize(int maxResponseSize)
已过时。Set the default maximum response size.void
setReadTimeout(int readTimeout)
已过时。Set the underlying URLConnection's read timeout (in milliseconds).void
setSslContext(io.netty.handler.ssl.SslContext sslContext)
已过时。Set the SSL context.
字段详细资料
DEFAULT_MAX_RESPONSE_SIZE
public static final int DEFAULT_MAX_RESPONSE_SIZE
已过时。The default maximum response size.- 另请参阅:
setMaxResponseSize(int)
, 常量字段值
构造器详细资料
Netty4ClientHttpRequestFactory
public Netty4ClientHttpRequestFactory()
已过时。Create a newNetty4ClientHttpRequestFactory
with a defaultNioEventLoopGroup
.
Netty4ClientHttpRequestFactory
public Netty4ClientHttpRequestFactory(io.netty.channel.EventLoopGroup eventLoopGroup)
已过时。Create a newNetty4ClientHttpRequestFactory
with the givenEventLoopGroup
.NOTE: the given group will not be shutdown by this factory; doing so becomes the responsibility of the caller.
方法详细资料
setMaxResponseSize
public void setMaxResponseSize(int maxResponseSize)
已过时。Set the default maximum response size.By default this is set to
DEFAULT_MAX_RESPONSE_SIZE
.- 从以下版本开始:
- 4.1.5
- 另请参阅:
HttpObjectAggregator(int)
setSslContext
public void setSslContext(io.netty.handler.ssl.SslContext sslContext)
已过时。Set the SSL context. When configured it is used to create and insert anSslHandler
in the channel pipeline.A default client SslContext is configured if none has been provided.
setConnectTimeout
public void setConnectTimeout(int connectTimeout)
已过时。Set the underlying connect timeout (in milliseconds). A timeout value of 0 specifies an infinite timeout.- 另请参阅:
ChannelConfig.setConnectTimeoutMillis(int)
setReadTimeout
public void setReadTimeout(int readTimeout)
已过时。Set the underlying URLConnection's read timeout (in milliseconds). A timeout value of 0 specifies an infinite timeout.- 另请参阅:
ReadTimeoutHandler
afterPropertiesSet
public void afterPropertiesSet()
已过时。从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- 指定者:
afterPropertiesSet
在接口中InitializingBean
createRequest
public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException
已过时。从接口复制的说明:ClientHttpRequestFactory
Create a newClientHttpRequest
for the specified URI and HTTP method.The returned request can be written to, and then executed by calling
ClientHttpRequest.execute()
.- 指定者:
createRequest
在接口中ClientHttpRequestFactory
- 参数:
uri
- the URI to create a request forhttpMethod
- the HTTP method to execute- 返回:
- the created request
- 抛出:
IOException
- in case of I/O errors
createAsyncRequest
public AsyncClientHttpRequest createAsyncRequest(URI uri, HttpMethod httpMethod) throws IOException
已过时。从接口复制的说明:AsyncClientHttpRequestFactory
Create a new asynchronousAsyncClientHttpRequest
for the specified URI and HTTP method.The returned request can be written to, and then executed by calling
AsyncClientHttpRequest.executeAsync()
.- 指定者:
createAsyncRequest
在接口中AsyncClientHttpRequestFactory
- 参数:
uri
- the URI to create a request forhttpMethod
- the HTTP method to execute- 返回:
- the created request
- 抛出:
IOException
- in case of I/O errors
configureChannel
protected void configureChannel(io.netty.channel.socket.SocketChannelConfig config)
已过时。Template method for changing properties on the givenSocketChannelConfig
.The default implementation sets the connect timeout based on the set property.
- 参数:
config
- the channel configuration
destroy
public void destroy() throws InterruptedException
已过时。从接口复制的说明:DisposableBean
Invoked by the containingBeanFactory
on destruction of a bean.- 指定者:
destroy
在接口中DisposableBean
- 抛出:
InterruptedException