mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
19d991a67b
Prior to this commit, resource management around `ClientHttpRequestFactory` and `RestTemplate` was unclear. Some factories implementation were implementing a `DisposableBean` and other contracts were not managing request factory resources. In the meantime, neither `ClientHttpRequestFactory` nor `RestTemplate` are typically meant to be contributed as beans to the application context. Most often, they're instantiated within beans and their lifecycle should be managed by those. This commit makes all `ClientHttpRequestFactory` `Closeable` and ensures that all existing implementations have a similar behavior between `dispose()` and `close()`. Since `RestTemplate` (actually `HttpAccessor`) can instantiate factories on its own, they also now extend `Closeable` to properly close those resources, if not externally managed. Closes gh-29010