public class StickyStrategy<T> extends Object implements ProviderStrategy<T>
Constructor and Description |
---|
StickyStrategy(ProviderStrategy<T> masterStrategy) |
Modifier and Type | Method and Description |
---|---|
ServiceInstance<T> |
getInstance(InstanceProvider<T> instanceProvider)
Given a source of instances, return one of them for a single use.
|
int |
getInstanceNumber()
Each time a new instance is picked, an internal counter is incremented.
|
public StickyStrategy(ProviderStrategy<T> masterStrategy)
masterStrategy
- the strategy to use for picking the sticky instancepublic ServiceInstance<T> getInstance(InstanceProvider<T> instanceProvider) throws Exception
ProviderStrategy
getInstance
in interface ProviderStrategy<T>
instanceProvider
- the instance providerException
- any errorspublic int getInstanceNumber()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.