Annotation Interface ImportHttpServices
@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 @interface
Container annotation that is necessary for the repeatable@ImportHttpServices
annotation, 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 methodHttpExchange
annotations.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 methodHttpExchange
annotations.The performed scan, however, filters out interfaces annotated with
HttpServiceClient
that are instead supported byAbstractClientHttpServiceRegistrar
.- 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.UNSPECIFIED
in which caseRestClient
is used, but this default can be changed viaAbstractHttpServiceRegistrar.setDefaultClientType(org.springframework.web.service.registry.HttpServiceGroup.ClientType)
.- Default:
UNSPECIFIED
-