Package io.micronaut.http.client
Interface HttpClientRegistry<T extends HttpClient>
-
- Type Parameters:
T- Reactive HTTP Client
public interface HttpClientRegistry<T extends HttpClient>Interface for managing the construction and lifecycle of instances ofHttpClientclients.- Since:
- 3.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddisposeClient(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)Dispose of the client defined by the given metadata.TgetClient(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)Return the client for the given annotation metadata.TgetClient(io.micronaut.http.HttpVersion httpVersion, java.lang.String clientId, java.lang.String path)Return the client for the client ID and path.default TgetDefaultClient()TresolveClient(io.micronaut.inject.InjectionPoint<?> injectionPoint, LoadBalancer loadBalancer, HttpClientConfiguration configuration, io.micronaut.context.BeanContext beanContext)Resolves aHttpClientfor the given injection point.
-
-
-
Method Detail
-
getClient
@NonNull T getClient(@NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
Return the client for the given annotation metadata.- Parameters:
annotationMetadata- The annotation metadata.- Returns:
- The client
-
getClient
@NonNull T getClient(io.micronaut.http.HttpVersion httpVersion, @NonNull java.lang.String clientId, @Nullable java.lang.String path)
Return the client for the client ID and path.- Parameters:
httpVersion- The HTTP versionclientId- The client IDpath- The path (Optional)- Returns:
- The client
-
resolveClient
@NonNull T resolveClient(@Nullable io.micronaut.inject.InjectionPoint<?> injectionPoint, @Nullable LoadBalancer loadBalancer, @Nullable HttpClientConfiguration configuration, @NonNull io.micronaut.context.BeanContext beanContext)
Resolves aHttpClientfor the given injection point.- Parameters:
injectionPoint- The injection pointloadBalancer- The load balancer to use (Optional)configuration- The configuration (Optional)beanContext- The bean context to use- Returns:
- The HTTP Client
-
disposeClient
void disposeClient(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
Dispose of the client defined by the given metadata.- Parameters:
annotationMetadata- The annotation metadata
-
getDefaultClient
default T getDefaultClient()
- Returns:
- Return the default HTTP client.
-
-