Annotation Interface ImportHttpServices
@Target(TYPE)
@Retention(RUNTIME)
@Documented
@Repeatable(ImportHttpServices.Container.class)
@Import(org.springframework.web.service.registry.ImportHttpServiceRegistrar.class)
public @interface ImportHttpServices
Annotation to declare HTTP Service types (interfaces with
@HttpExchange methods) for which to create client proxies,
and have those proxies registered as beans.
This is a repeatable annotation that is expected on
@Configuration
classes. Each annotation is associated with an HttpServiceGroup
identified by name through the group() attribute.
The HTTP Services for each group can be listed via types(), or
detected via basePackageClasses() or basePackages().
An application can autowire HTTP Service proxy beans, or autowire the
HttpServiceProxyRegistry from which to obtain proxies.
- Since:
- 7.0
- Author:
- Olga Maciaszek-Sharma, Rossen Stoyanchev
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceContainer annotation that is necessary for the repeatable@ImportHttpServicesannotation, but does not need to be declared in application code. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?>[]Detect HTTP Services in the packages of the specified classes, looking for interfaces with type or methodHttpExchangeannotations.String[]Variant ofbasePackageClasses()with a list of packages specified by package name.Specify the type of client to use for the group.The name of the HTTP Service group.Class<?>[]A list of HTTP Service types to include in the group.Class<?>[]An alias fortypes().
-
Element Details
-
value
-
types
-
group
String groupThe name of the HTTP Service group.If not specified, declared HTTP Services are grouped under the
HttpServiceGroup.DEFAULT_GROUP_NAME.- Default:
"default"
-
basePackageClasses
Class<?>[] basePackageClassesDetect HTTP Services in the packages of the specified classes, looking for interfaces with type or methodHttpExchangeannotations.- Default:
{}
-
basePackages
String[] basePackagesVariant ofbasePackageClasses()with a list of packages specified by package name.- Default:
{}
-
clientType
HttpServiceGroup.ClientType clientTypeSpecify the type of client to use for the group.By default, this is
HttpServiceGroup.ClientType.UNSPECIFIEDin which caseRestClientis used, but this default can be changed viaAbstractHttpServiceRegistrar.setDefaultClientType(HttpServiceGroup.ClientType).- Default:
UNSPECIFIED
-