Package io.micronaut.discovery
Class CompositeDiscoveryClient
java.lang.Object
io.micronaut.discovery.CompositeDiscoveryClient
- All Implemented Interfaces:
Described,DiscoveryClient,Closeable,AutoCloseable
- Direct Known Subclasses:
DefaultCompositeDiscoveryClient
A composite implementation combining all registered
DiscoveryClient instances.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCompositeDiscoveryClient(DiscoveryClient[] discoveryClients) Construct the CompositeDiscoveryClient from all discovery clients. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()A description that describes this object.The underlying clients.getInstances(String serviceId) Obtain a list ofServiceInstancefor the given service id.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micronaut.core.naming.Described
getDescription
-
Constructor Details
-
CompositeDiscoveryClient
Construct the CompositeDiscoveryClient from all discovery clients.- Parameters:
discoveryClients- The service discovery clients
-
-
Method Details
-
getDescription
Description copied from interface:DescribedA description that describes this object.- Specified by:
getDescriptionin interfaceDescribed- Returns:
- The description
-
getDiscoveryClients
The underlying clients.- Returns:
- The clients
-
getInstances
Description copied from interface:DiscoveryClientObtain a list ofServiceInstancefor the given service id.- Specified by:
getInstancesin interfaceDiscoveryClient- Parameters:
serviceId- The service id- Returns:
- A
Publisherthat emits a list ofServiceInstance
-
getServiceIds
- Specified by:
getServiceIdsin interfaceDiscoveryClient- Returns:
- The known service IDs
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
toString
-