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
This commit is contained in:
rstoyanchev
2025-07-31 05:22:44 +01:00
parent 9dbe304cf6
commit c8b2a0f830
7 changed files with 22 additions and 19 deletions
@@ -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.
*
* <p>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
@@ -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.
* <p>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);
@@ -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)
@@ -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) {
@@ -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.
* <p>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();