Package org.springframework.http.client
Class AbstractClientHttpRequestFactoryWrapper
java.lang.Object
org.springframework.http.client.AbstractClientHttpRequestFactoryWrapper
- All Implemented Interfaces:
ClientHttpRequestFactory
- Direct Known Subclasses:
BufferingClientHttpRequestFactory
,InterceptingClientHttpRequestFactory
public abstract class AbstractClientHttpRequestFactoryWrapper
extends Object
implements ClientHttpRequestFactory
Abstract base class for
ClientHttpRequestFactory
implementations
that decorate another delegate request factory.- Since:
- 3.1
- Author:
- Arjen Poutsma
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractClientHttpRequestFactoryWrapper
(ClientHttpRequestFactory requestFactory) Create aAbstractClientHttpRequestFactoryWrapper
wrapping the given request factory. -
Method Summary
Modifier and TypeMethodDescriptionfinal ClientHttpRequest
createRequest
(URI uri, HttpMethod httpMethod) This implementation simply callscreateRequest(URI, HttpMethod, ClientHttpRequestFactory)
with the wrapped request factory provided to the constructor.protected abstract ClientHttpRequest
createRequest
(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory) Create a newClientHttpRequest
for the specified URI and HTTP method by using the passed-on request factory.Return the delegate request factory.
-
Constructor Details
-
AbstractClientHttpRequestFactoryWrapper
Create aAbstractClientHttpRequestFactoryWrapper
wrapping the given request factory.- Parameters:
requestFactory
- the request factory to be wrapped
-
-
Method Details
-
createRequest
This implementation simply callscreateRequest(URI, HttpMethod, ClientHttpRequestFactory)
with the wrapped request factory provided to the constructor.- Specified by:
createRequest
in interfaceClientHttpRequestFactory
- Parameters:
uri
- the URI to create a request forhttpMethod
- the HTTP method to execute- Returns:
- the created request
- Throws:
IOException
- in case of I/O errors
-
getDelegate
Return the delegate request factory. -
createRequest
protected abstract ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory) throws IOException Create a newClientHttpRequest
for the specified URI and HTTP method by using the passed-on request factory.Called from
createRequest(URI, HttpMethod)
.- Parameters:
uri
- the URI to create a request forhttpMethod
- the HTTP method to executerequestFactory
- the wrapped request factory- Returns:
- the created request
- Throws:
IOException
- in case of I/O errors
-