Class SameInstancePreferenceServiceInstanceListSupplier
- java.lang.Object
-
- org.springframework.cloud.loadbalancer.core.DelegatingServiceInstanceListSupplier
-
- org.springframework.cloud.loadbalancer.core.SameInstancePreferenceServiceInstanceListSupplier
-
- All Implemented Interfaces:
Supplier<reactor.core.publisher.Flux<List<ServiceInstance>>>,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,SelectedInstanceCallback,ServiceInstanceListSupplier
public class SameInstancePreferenceServiceInstanceListSupplier extends DelegatingServiceInstanceListSupplier implements SelectedInstanceCallback
An implementation ofServiceInstanceListSupplierthat selects the previously chosen instance if it's available.- Since:
- 2.2.7
- Author:
- Olga Maciaszek-Sharma
-
-
Field Summary
-
Fields inherited from class org.springframework.cloud.loadbalancer.core.DelegatingServiceInstanceListSupplier
delegate
-
-
Constructor Summary
Constructors Constructor Description SameInstancePreferenceServiceInstanceListSupplier(ServiceInstanceListSupplier delegate)SameInstancePreferenceServiceInstanceListSupplier(ServiceInstanceListSupplier delegate, ReactiveLoadBalancer.Factory<ServiceInstance> loadBalancerClientFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Flux<List<ServiceInstance>>get()reactor.core.publisher.Flux<List<ServiceInstance>>get(Request request)StringgetServiceId()voidselectedServiceInstance(ServiceInstance serviceInstance)Passes the selectedServiceInstanceas an argument.-
Methods inherited from class org.springframework.cloud.loadbalancer.core.DelegatingServiceInstanceListSupplier
afterPropertiesSet, destroy, getDelegate
-
-
-
-
Constructor Detail
-
SameInstancePreferenceServiceInstanceListSupplier
public SameInstancePreferenceServiceInstanceListSupplier(ServiceInstanceListSupplier delegate)
-
SameInstancePreferenceServiceInstanceListSupplier
public SameInstancePreferenceServiceInstanceListSupplier(ServiceInstanceListSupplier delegate, ReactiveLoadBalancer.Factory<ServiceInstance> loadBalancerClientFactory)
-
-
Method Detail
-
getServiceId
public String getServiceId()
- Specified by:
getServiceIdin interfaceServiceInstanceListSupplier- Overrides:
getServiceIdin classDelegatingServiceInstanceListSupplier
-
get
public reactor.core.publisher.Flux<List<ServiceInstance>> get()
- Specified by:
getin interfaceSupplier<reactor.core.publisher.Flux<List<ServiceInstance>>>
-
get
public reactor.core.publisher.Flux<List<ServiceInstance>> get(Request request)
- Specified by:
getin interfaceServiceInstanceListSupplier
-
selectedServiceInstance
public void selectedServiceInstance(ServiceInstance serviceInstance)
Description copied from interface:SelectedInstanceCallbackPasses the selectedServiceInstanceas an argument.- Specified by:
selectedServiceInstancein interfaceSelectedInstanceCallback- Parameters:
serviceInstance- that has been selected
-
-