Browse Source

Rename HttpServiceGroups to ImportHttpServiceGroups

See gh-33992
pull/34696/head
rstoyanchev 12 months ago
parent
commit
ebdebbbd06
  1. 1
      spring-web/src/main/java/org/springframework/web/service/registry/AbstractHttpServiceRegistrar.java
  2. 4
      spring-web/src/main/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrar.java
  3. 4
      spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroup.java
  4. 1
      spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroupConfigurer.java
  5. 1
      spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistry.java
  6. 1
      spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBean.java
  7. 3
      spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServiceGroups.java
  8. 4
      spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServices.java
  9. 2
      spring-web/src/test/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrarTests.java
  10. 8
      spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientProxyRegistryIntegrationTests.java

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

@ -68,6 +68,7 @@ import org.springframework.web.service.annotation.HttpExchange; @@ -68,6 +68,7 @@ import org.springframework.web.service.annotation.HttpExchange;
*
* @author Rossen Stoyanchev
* @author Phillip Webb
* @author Olga Maciaszek-Sharma
* @since 7.0
* @see ImportHttpServices
* @see HttpServiceProxyRegistryFactoryBean

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

@ -25,6 +25,8 @@ import org.springframework.core.type.AnnotationMetadata; @@ -25,6 +25,8 @@ import org.springframework.core.type.AnnotationMetadata;
* to determine the HTTP services and groups to register.
*
* @author Rossen Stoyanchev
* @author Phillip Webb
* @author Olga Maciaszek-Sharma
* @since 7.0
*/
class AnnotationHttpServiceRegistrar extends AbstractHttpServiceRegistrar {
@ -32,7 +34,7 @@ class AnnotationHttpServiceRegistrar extends AbstractHttpServiceRegistrar { @@ -32,7 +34,7 @@ class AnnotationHttpServiceRegistrar extends AbstractHttpServiceRegistrar {
@Override
protected void registerHttpServices(GroupRegistry registry, AnnotationMetadata importMetadata) {
MergedAnnotation<?> groupsAnnot = importMetadata.getAnnotations().get(HttpServiceGroups.class);
MergedAnnotation<?> groupsAnnot = importMetadata.getAnnotations().get(ImportHttpServiceGroups.class);
if (groupsAnnot.isPresent()) {
HttpServiceGroup.ClientType clientType = groupsAnnot.getEnum("clientType", HttpServiceGroup.ClientType.class);
for (MergedAnnotation<?> annot : groupsAnnot.getAnnotationArray("value", ImportHttpServices.class)) {

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

@ -23,8 +23,8 @@ import java.util.Set; @@ -23,8 +23,8 @@ import java.util.Set;
* {@link org.springframework.web.service.invoker.HttpServiceProxyFactory} and
* HTTP client setup.
*
* @author Olga Maciaszek-Sharma
* @author Rossen Stoyanchev
* @author Olga Maciaszek-Sharma
* @since 7.0
*/
public interface HttpServiceGroup {
@ -70,7 +70,7 @@ public interface HttpServiceGroup { @@ -70,7 +70,7 @@ public interface HttpServiceGroup {
/**
* Not specified, falling back on a default.
* @see ImportHttpServices#clientType()
* @see HttpServiceGroups#clientType()
* @see ImportHttpServiceGroups#clientType()
* @see AbstractHttpServiceRegistrar#setDefaultClientType
*/
UNSPECIFIED;

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

@ -26,6 +26,7 @@ import org.springframework.web.service.invoker.HttpServiceProxyFactory; @@ -26,6 +26,7 @@ import org.springframework.web.service.invoker.HttpServiceProxyFactory;
* Callback to configure the set of declared {@link HttpServiceGroup}s.
*
* @author Rossen Stoyanchev
* @author Olga Maciaszek-Sharma
* @since 7.0
* @param <CB> the type of client builder, i.e. {@code RestClient} or {@code WebClient} builder.
*/

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

@ -22,6 +22,7 @@ import org.jspecify.annotations.Nullable; @@ -22,6 +22,7 @@ import org.jspecify.annotations.Nullable;
* A registry that contains HTTP Service client proxies.
*
* @author Rossen Stoyanchev
* @author Olga Maciaszek-Sharma
* @since 7.0
* @see ImportHttpServices
* @see HttpServiceProxyRegistryFactoryBean

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

@ -52,6 +52,7 @@ import org.springframework.web.service.invoker.HttpServiceProxyFactory; @@ -52,6 +52,7 @@ import org.springframework.web.service.invoker.HttpServiceProxyFactory;
*
* @author Rossen Stoyanchev
* @author Phillip Webb
* @author Olga Maciaszek-Sharma
* @since 7.0
* @see AbstractHttpServiceRegistrar
*/

3
spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroups.java → spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServiceGroups.java

@ -32,6 +32,7 @@ import org.springframework.core.annotation.AliasFor; @@ -32,6 +32,7 @@ import org.springframework.core.annotation.AliasFor;
* may be used to set the {@link #clientType()} and that would be inherited by
* all nested annotations.
*
* @author Olga Maciaszek-Sharma
* @author Rossen Stoyanchev
* @since 7.0
*/
@ -39,7 +40,7 @@ import org.springframework.core.annotation.AliasFor; @@ -39,7 +40,7 @@ import org.springframework.core.annotation.AliasFor;
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import(AnnotationHttpServiceRegistrar.class)
public @interface HttpServiceGroups {
public @interface ImportHttpServiceGroups {
/**
* Alias for {@link #groups()}.

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

@ -46,12 +46,12 @@ import org.springframework.web.service.annotation.HttpExchange; @@ -46,12 +46,12 @@ import org.springframework.web.service.annotation.HttpExchange;
* @author Olga Maciaszek-Sharma
* @author Rossen Stoyanchev
* @since 7.0
* @see HttpServiceGroups
* @see ImportHttpServiceGroups
* @see AbstractHttpServiceRegistrar
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Repeatable(HttpServiceGroups.class)
@Repeatable(ImportHttpServiceGroups.class)
@Import(AnnotationHttpServiceRegistrar.class)
@Documented
public @interface ImportHttpServices {

2
spring-web/src/test/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrarTests.java

@ -97,7 +97,7 @@ public class AnnotationHttpServiceRegistrarTests { @@ -97,7 +97,7 @@ public class AnnotationHttpServiceRegistrarTests {
private static class ScanConfig {
}
@HttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = {
@ImportHttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = {
@ImportHttpServices(group = ECHO_GROUP, types = {EchoA.class}),
@ImportHttpServices(group = GREETING_GROUP, types = {GreetingA.class})
})

8
spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientProxyRegistryIntegrationTests.java

@ -37,9 +37,9 @@ import org.springframework.web.reactive.function.client.support.greeting.Greetin @@ -37,9 +37,9 @@ import org.springframework.web.reactive.function.client.support.greeting.Greetin
import org.springframework.web.reactive.function.client.support.greeting.GreetingB;
import org.springframework.web.service.registry.AbstractHttpServiceRegistrar;
import org.springframework.web.service.registry.HttpServiceGroup.ClientType;
import org.springframework.web.service.registry.HttpServiceGroups;
import org.springframework.web.service.registry.HttpServiceProxyRegistry;
import org.springframework.web.service.registry.ImportHttpServices;
import org.springframework.web.service.registry.ImportHttpServiceGroups;
import org.springframework.web.service.registry.HttpServiceProxyRegistry;
import static org.assertj.core.api.Assertions.assertThat;
@ -126,7 +126,7 @@ public class WebClientProxyRegistryIntegrationTests { @@ -126,7 +126,7 @@ public class WebClientProxyRegistryIntegrationTests {
@Configuration(proxyBeanMethods = false)
@HttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = {
@ImportHttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = {
@ImportHttpServices(group = "echo", types = {EchoA.class, EchoB.class}),
@ImportHttpServices(group = "greeting", types = {GreetingA.class, GreetingB.class})
})
@ -135,7 +135,7 @@ public class WebClientProxyRegistryIntegrationTests { @@ -135,7 +135,7 @@ public class WebClientProxyRegistryIntegrationTests {
@Configuration(proxyBeanMethods = false)
@HttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = {
@ImportHttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = {
@ImportHttpServices(group = "echo", basePackageClasses = EchoA.class),
@ImportHttpServices(group = "greeting", basePackageClasses = GreetingA.class)
})

Loading…
Cancel
Save