diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceClientRegistrarSupport.java b/spring-web/src/main/java/org/springframework/web/service/registry/AbstractClientHttpServiceRegistrar.java similarity index 91% rename from spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceClientRegistrarSupport.java rename to spring-web/src/main/java/org/springframework/web/service/registry/AbstractClientHttpServiceRegistrar.java index ad9d22d2e58..e3fa444cc30 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceClientRegistrarSupport.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/AbstractClientHttpServiceRegistrar.java @@ -24,17 +24,19 @@ import org.springframework.core.annotation.MergedAnnotations; import org.springframework.core.type.AnnotationMetadata; /** - * Base class for an {@link AbstractHttpServiceRegistrar} to detects and register - * {@link HttpServiceClient @HttpServiceClient} annotated interfaces. + * Base class for an HTTP Service registrar that detects + * {@link HttpServiceClient @HttpServiceClient} annotated interfaces and + * registers them. * *

Subclasses need to implement * {@link #registerHttpServices(GroupRegistry, AnnotationMetadata)} and invoke - * {@link #findAndRegisterHttpServiceClients(GroupRegistry, List)}. + * {@link #findAndRegisterHttpServiceClients(GroupRegistry, List)} with the + * list of base packages to scan. * * @author Rossen Stoyanchev * @since 7.0 */ -public abstract class HttpServiceClientRegistrarSupport extends AbstractHttpServiceRegistrar { +public abstract class AbstractClientHttpServiceRegistrar extends AbstractHttpServiceRegistrar { /** * Find all HTTP Services under the given base packages that also have an diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/AbstractHttpServiceRegistrar.java b/spring-web/src/main/java/org/springframework/web/service/registry/AbstractHttpServiceRegistrar.java index 4b55e809102..9fc72368d51 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/AbstractHttpServiceRegistrar.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/AbstractHttpServiceRegistrar.java @@ -226,7 +226,8 @@ public abstract class AbstractHttpServiceRegistrar implements protected interface GroupRegistry { /** - * Perform HTTP Service registrations for the given group. + * Perform HTTP Service registrations for the given group, either + * creating the group if it does not exist, or updating the existing one. */ default GroupSpec forGroup(String name) { return forGroup(name, HttpServiceGroup.ClientType.UNSPECIFIED); @@ -251,7 +252,7 @@ public abstract class AbstractHttpServiceRegistrar implements interface GroupSpec { /** - * Register HTTP Service types to create proxies for. + * Register HTTP Service types associated with this group. */ GroupSpec register(Class... serviceTypes); @@ -265,7 +266,7 @@ public abstract class AbstractHttpServiceRegistrar implements * interfaces with type or method {@link HttpExchange} annotations. *

The performed scan, however, filters out any interfaces * annotated with {@link HttpServiceClient} that are instead supported - * by {@link HttpServiceClientRegistrarSupport}. + * by {@link AbstractClientHttpServiceRegistrar}. */ GroupSpec detectInBasePackages(Class... packageClasses); diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceClient.java b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceClient.java index 56fe47a93fe..03c285b7629 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceClient.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceClient.java @@ -27,11 +27,11 @@ import org.springframework.core.annotation.AliasFor; /** * Annotation to mark an HTTP Service interface as a candidate client proxy creation. - * Supported by extensions of {@link HttpServiceClientRegistrarSupport}. + * Supported through the import of an {@link AbstractClientHttpServiceRegistrar}. * * @author Rossen Stoyanchev * @since 7.0 - * @see HttpServiceClientRegistrarSupport + * @see AbstractClientHttpServiceRegistrar */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServicesRegistrar.java b/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServiceRegistrar.java similarity index 96% rename from spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServicesRegistrar.java rename to spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServiceRegistrar.java index c23845a3784..81f165e59d0 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServicesRegistrar.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServiceRegistrar.java @@ -29,7 +29,7 @@ import org.springframework.core.type.AnnotationMetadata; * @author Olga Maciaszek-Sharma * @since 7.0 */ -class ImportHttpServicesRegistrar extends AbstractHttpServiceRegistrar { +class ImportHttpServiceRegistrar extends AbstractHttpServiceRegistrar { @Override protected void registerHttpServices(GroupRegistry registry, AnnotationMetadata metadata) { diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServices.java b/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServices.java index 4dbd7450779..b1abea0323e 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServices.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServices.java @@ -53,7 +53,7 @@ import org.springframework.web.service.annotation.HttpExchange; @Retention(RetentionPolicy.RUNTIME) @Documented @Repeatable(ImportHttpServices.Container.class) -@Import(ImportHttpServicesRegistrar.class) +@Import(ImportHttpServiceRegistrar.class) public @interface ImportHttpServices { /** @@ -80,7 +80,7 @@ public @interface ImportHttpServices { * for interfaces with type or method {@link HttpExchange} annotations. *

The performed scan, however, filters out interfaces annotated with * {@link HttpServiceClient} that are instead supported by - * {@link HttpServiceClientRegistrarSupport}. + * {@link AbstractClientHttpServiceRegistrar}. */ Class[] basePackageClasses() default {}; @@ -107,7 +107,7 @@ public @interface ImportHttpServices { @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented - @Import(ImportHttpServicesRegistrar.class) + @Import(ImportHttpServiceRegistrar.class) @interface Container { ImportHttpServices[] value(); diff --git a/spring-web/src/test/java/org/springframework/web/service/registry/HttpServiceClientRegistrarSupportTests.java b/spring-web/src/test/java/org/springframework/web/service/registry/ClientHttpServiceRegistrarTests.java similarity index 92% rename from spring-web/src/test/java/org/springframework/web/service/registry/HttpServiceClientRegistrarSupportTests.java rename to spring-web/src/test/java/org/springframework/web/service/registry/ClientHttpServiceRegistrarTests.java index 3045eb97958..7f60b777538 100644 --- a/spring-web/src/test/java/org/springframework/web/service/registry/HttpServiceClientRegistrarSupportTests.java +++ b/spring-web/src/test/java/org/springframework/web/service/registry/ClientHttpServiceRegistrarTests.java @@ -33,10 +33,10 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; /** - * Unit tests for {@link HttpServiceClientRegistrarSupport}. + * Unit tests for {@link AbstractClientHttpServiceRegistrar}. * @author Rossen Stoyanchev */ -public class HttpServiceClientRegistrarSupportTests { +public class ClientHttpServiceRegistrarTests { private final TestGroupRegistry groupRegistry = new TestGroupRegistry(); @@ -47,7 +47,7 @@ public class HttpServiceClientRegistrarSupportTests { List basePackages = List.of( BasicClient.class.getPackageName(), EchoClientA.class.getPackageName()); - HttpServiceClientRegistrarSupport registrar = new HttpServiceClientRegistrarSupport() { + AbstractClientHttpServiceRegistrar registrar = new AbstractClientHttpServiceRegistrar() { @Override protected void registerHttpServices(GroupRegistry registry, AnnotationMetadata importingClassMetadata) { diff --git a/spring-web/src/test/java/org/springframework/web/service/registry/ImportHttpServicesRegistrarTests.java b/spring-web/src/test/java/org/springframework/web/service/registry/ImportHttpServiceRegistrarTests.java similarity index 97% rename from spring-web/src/test/java/org/springframework/web/service/registry/ImportHttpServicesRegistrarTests.java rename to spring-web/src/test/java/org/springframework/web/service/registry/ImportHttpServiceRegistrarTests.java index d3f45d3c3ff..8959cb2f2de 100644 --- a/spring-web/src/test/java/org/springframework/web/service/registry/ImportHttpServicesRegistrarTests.java +++ b/spring-web/src/test/java/org/springframework/web/service/registry/ImportHttpServiceRegistrarTests.java @@ -39,12 +39,12 @@ import org.springframework.web.service.registry.greeting.GreetingB; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link ImportHttpServicesRegistrar}. + * Tests for {@link ImportHttpServiceRegistrar}. * * @author Rossen Stoyanchev * @author Stephane Nicoll */ -public class ImportHttpServicesRegistrarTests { +public class ImportHttpServiceRegistrarTests { private static final String ECHO_GROUP = "echo"; @@ -53,7 +53,7 @@ public class ImportHttpServicesRegistrarTests { private final TestGroupRegistry groupRegistry = new TestGroupRegistry(); - private final ImportHttpServicesRegistrar registrar = new ImportHttpServicesRegistrar(); + private final ImportHttpServiceRegistrar registrar = new ImportHttpServiceRegistrar(); @Test