Skip to content

Commit ae88bba

Browse files
committed
Reintroduce org.springframework.http.client.reactive.ReactorResourceFactory
This commit reintroduces a deprecated ReactorResourceFactory in org.springframework.http.client.reactive package that extends the one in org.springframework.http.client package to avoid an API breaking change and to provide a smoother upgrade experience. Closes gh-31399
1 parent 8414488 commit ae88bba

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2002-2023 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.http.client.reactive;
18+
19+
import reactor.netty.resources.ConnectionProvider;
20+
import reactor.netty.resources.LoopResources;
21+
22+
import org.springframework.beans.factory.DisposableBean;
23+
import org.springframework.beans.factory.InitializingBean;
24+
import org.springframework.context.Lifecycle;
25+
26+
/**
27+
* Factory to manage Reactor Netty resources, i.e. {@link LoopResources} for
28+
* event loop threads, and {@link ConnectionProvider} for the connection pool,
29+
* within the lifecycle of a Spring {@code ApplicationContext}.
30+
*
31+
* <p>This factory implements {@link InitializingBean}, {@link DisposableBean}
32+
* and {@link Lifecycle} and is expected typically to be declared as a
33+
* Spring-managed bean.
34+
*
35+
* <p>Notice that after a {@link Lifecycle} stop/restart, new instances of
36+
* the configured {@link LoopResources} and {@link ConnectionProvider} are
37+
* created, so any references to those should be updated.
38+
*
39+
* @author Rossen Stoyanchev
40+
* @author Brian Clozel
41+
* @author Sebastien Deleuze
42+
* @since 5.1
43+
* @deprecated since 6.1 due to a package change; use {@link org.springframework.http.client.ReactorResourceFactory} instead.
44+
*/
45+
@Deprecated(since = "6.1")
46+
public class ReactorResourceFactory extends org.springframework.http.client.ReactorResourceFactory {
47+
}

0 commit comments

Comments
 (0)