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
ModifierConstructorDescriptionprotected
CompositeDiscoveryClient
(DiscoveryClient[] discoveryClients) Construct the CompositeDiscoveryClient from all discovery clients. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
A description that describes this object.The underlying clients.getInstances
(String serviceId) Obtain a list ofServiceInstance
for the given service id.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:Described
A description that describes this object.- Specified by:
getDescription
in interfaceDescribed
- Returns:
- The description
-
getDiscoveryClients
The underlying clients.- Returns:
- The clients
-
getInstances
Description copied from interface:DiscoveryClient
Obtain a list ofServiceInstance
for the given service id.- Specified by:
getInstances
in interfaceDiscoveryClient
- Parameters:
serviceId
- The service id- Returns:
- A
Publisher
that emits a list ofServiceInstance
-
getServiceIds
- Specified by:
getServiceIds
in interfaceDiscoveryClient
- Returns:
- The known service IDs
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
toString
-