Skip to content

Commit c8b2a0f

Browse files
committed
Rename HttpServiceClientRegistrarSupport
to AbstractClientHttpServiceRegistrar since it is a registrar and an extension of Abstract[HttpServiceRegistrar]. Also, a more friendly name for use in application configuration. See gh-35244
1 parent 9dbe304 commit c8b2a0f

File tree

7 files changed

+22
-19
lines changed

7 files changed

+22
-19
lines changed
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@
2424
import org.springframework.core.type.AnnotationMetadata;
2525

2626
/**
27-
* Base class for an {@link AbstractHttpServiceRegistrar} to detects and register
28-
* {@link HttpServiceClient @HttpServiceClient} annotated interfaces.
27+
* Base class for an HTTP Service registrar that detects
28+
* {@link HttpServiceClient @HttpServiceClient} annotated interfaces and
29+
* registers them.
2930
*
3031
* <p>Subclasses need to implement
3132
* {@link #registerHttpServices(GroupRegistry, AnnotationMetadata)} and invoke
32-
* {@link #findAndRegisterHttpServiceClients(GroupRegistry, List)}.
33+
* {@link #findAndRegisterHttpServiceClients(GroupRegistry, List)} with the
34+
* list of base packages to scan.
3335
*
3436
* @author Rossen Stoyanchev
3537
* @since 7.0
3638
*/
37-
public abstract class HttpServiceClientRegistrarSupport extends AbstractHttpServiceRegistrar {
39+
public abstract class AbstractClientHttpServiceRegistrar extends AbstractHttpServiceRegistrar {
3840

3941
/**
4042
* Find all HTTP Services under the given base packages that also have an

spring-web/src/main/java/org/springframework/web/service/registry/AbstractHttpServiceRegistrar.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ protected Stream<BeanDefinition> findHttpServices(String basePackage) {
226226
protected interface GroupRegistry {
227227

228228
/**
229-
* Perform HTTP Service registrations for the given group.
229+
* Perform HTTP Service registrations for the given group, either
230+
* creating the group if it does not exist, or updating the existing one.
230231
*/
231232
default GroupSpec forGroup(String name) {
232233
return forGroup(name, HttpServiceGroup.ClientType.UNSPECIFIED);
@@ -251,7 +252,7 @@ default GroupSpec forDefaultGroup() {
251252
interface GroupSpec {
252253

253254
/**
254-
* Register HTTP Service types to create proxies for.
255+
* Register HTTP Service types associated with this group.
255256
*/
256257
GroupSpec register(Class<?>... serviceTypes);
257258

@@ -265,7 +266,7 @@ interface GroupSpec {
265266
* interfaces with type or method {@link HttpExchange} annotations.
266267
* <p>The performed scan, however, filters out any interfaces
267268
* annotated with {@link HttpServiceClient} that are instead supported
268-
* by {@link HttpServiceClientRegistrarSupport}.
269+
* by {@link AbstractClientHttpServiceRegistrar}.
269270
*/
270271
GroupSpec detectInBasePackages(Class<?>... packageClasses);
271272

spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727

2828
/**
2929
* Annotation to mark an HTTP Service interface as a candidate client proxy creation.
30-
* Supported by extensions of {@link HttpServiceClientRegistrarSupport}.
30+
* Supported through the import of an {@link AbstractClientHttpServiceRegistrar}.
3131
*
3232
* @author Rossen Stoyanchev
3333
* @since 7.0
34-
* @see HttpServiceClientRegistrarSupport
34+
* @see AbstractClientHttpServiceRegistrar
3535
*/
3636
@Target(ElementType.TYPE)
3737
@Retention(RetentionPolicy.RUNTIME)

spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServicesRegistrar.java renamed to spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServiceRegistrar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @author Olga Maciaszek-Sharma
3030
* @since 7.0
3131
*/
32-
class ImportHttpServicesRegistrar extends AbstractHttpServiceRegistrar {
32+
class ImportHttpServiceRegistrar extends AbstractHttpServiceRegistrar {
3333

3434
@Override
3535
protected void registerHttpServices(GroupRegistry registry, AnnotationMetadata metadata) {

spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServices.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
@Retention(RetentionPolicy.RUNTIME)
5454
@Documented
5555
@Repeatable(ImportHttpServices.Container.class)
56-
@Import(ImportHttpServicesRegistrar.class)
56+
@Import(ImportHttpServiceRegistrar.class)
5757
public @interface ImportHttpServices {
5858

5959
/**
@@ -80,7 +80,7 @@
8080
* for interfaces with type or method {@link HttpExchange} annotations.
8181
* <p>The performed scan, however, filters out interfaces annotated with
8282
* {@link HttpServiceClient} that are instead supported by
83-
* {@link HttpServiceClientRegistrarSupport}.
83+
* {@link AbstractClientHttpServiceRegistrar}.
8484
*/
8585
Class<?>[] basePackageClasses() default {};
8686

@@ -107,7 +107,7 @@
107107
@Target(ElementType.TYPE)
108108
@Retention(RetentionPolicy.RUNTIME)
109109
@Documented
110-
@Import(ImportHttpServicesRegistrar.class)
110+
@Import(ImportHttpServiceRegistrar.class)
111111
@interface Container {
112112

113113
ImportHttpServices[] value();
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
import static org.mockito.Mockito.mock;
3434

3535
/**
36-
* Unit tests for {@link HttpServiceClientRegistrarSupport}.
36+
* Unit tests for {@link AbstractClientHttpServiceRegistrar}.
3737
* @author Rossen Stoyanchev
3838
*/
39-
public class HttpServiceClientRegistrarSupportTests {
39+
public class ClientHttpServiceRegistrarTests {
4040

4141
private final TestGroupRegistry groupRegistry = new TestGroupRegistry();
4242

@@ -47,7 +47,7 @@ void register() {
4747
List<String> basePackages = List.of(
4848
BasicClient.class.getPackageName(), EchoClientA.class.getPackageName());
4949

50-
HttpServiceClientRegistrarSupport registrar = new HttpServiceClientRegistrarSupport() {
50+
AbstractClientHttpServiceRegistrar registrar = new AbstractClientHttpServiceRegistrar() {
5151

5252
@Override
5353
protected void registerHttpServices(GroupRegistry registry, AnnotationMetadata importingClassMetadata) {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
import static org.assertj.core.api.Assertions.assertThat;
4040

4141
/**
42-
* Tests for {@link ImportHttpServicesRegistrar}.
42+
* Tests for {@link ImportHttpServiceRegistrar}.
4343
*
4444
* @author Rossen Stoyanchev
4545
* @author Stephane Nicoll
4646
*/
47-
public class ImportHttpServicesRegistrarTests {
47+
public class ImportHttpServiceRegistrarTests {
4848

4949
private static final String ECHO_GROUP = "echo";
5050

@@ -53,7 +53,7 @@ public class ImportHttpServicesRegistrarTests {
5353

5454
private final TestGroupRegistry groupRegistry = new TestGroupRegistry();
5555

56-
private final ImportHttpServicesRegistrar registrar = new ImportHttpServicesRegistrar();
56+
private final ImportHttpServiceRegistrar registrar = new ImportHttpServiceRegistrar();
5757

5858

5959
@Test

0 commit comments

Comments
 (0)