Module io.inverno.mod.discovery
Package io.inverno.mod.discovery
Class CompositeDiscoveryService<A extends ServiceInstance,B,C extends TrafficPolicy<A,B>>
java.lang.Object
io.inverno.mod.discovery.CompositeDiscoveryService<A,B,C>
- Type Parameters:
A- the type of service instanceB- the type of service requestC- the type of traffic policy
- All Implemented Interfaces:
DiscoveryService<A,B, C>
public class CompositeDiscoveryService<A extends ServiceInstance,B,C extends TrafficPolicy<A,B>>
extends Object
implements DiscoveryService<A,B,C>
A composite discovery service composing multiple discovery services.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeDiscoveryService(List<? extends DiscoveryService<? extends A, ? super B, ? super C>> discoveryServices) Creates a composite discovery service. -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of schemes supported by the discovery service.Resolves a service.booleanDetermines whether the discovery service supports the specified scheme.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.discovery.DiscoveryService
supports, supports
-
Constructor Details
-
CompositeDiscoveryService
public CompositeDiscoveryService(List<? extends DiscoveryService<? extends A, ? super B, throws IllegalArgumentException? super C>> discoveryServices) Creates a composite discovery service.
- Parameters:
discoveryServices- a list of discovery services to compose- Throws:
IllegalArgumentException- if the same scheme is supported by multiple discovery services
-
-
Method Details
-
supports
Description copied from interface:DiscoveryServiceDetermines whether the discovery service supports the specified scheme.
- Specified by:
supportsin interfaceDiscoveryService<A extends ServiceInstance,B, C extends TrafficPolicy<A, B>> - Parameters:
scheme- a URI scheme- Returns:
- true if the discovery service can resolve service URI with the specified scheme, false otherwise
-
getSupportedSchemes
Description copied from interface:DiscoveryServiceReturns the list of schemes supported by the discovery service.
- Specified by:
getSupportedSchemesin interfaceDiscoveryService<A extends ServiceInstance,B, C extends TrafficPolicy<A, B>> - Returns:
- a set of lower cased schemes
-
resolve
Description copied from interface:DiscoveryServiceResolves a service.
- Specified by:
resolvein interfaceDiscoveryService<A extends ServiceInstance,B, C extends TrafficPolicy<A, B>> - Parameters:
serviceId- a service IDtrafficPolicy- a traffic policy- Returns:
- a
Monoemitting the resolved service or an emptyMonoif no service could be resolved
-