Package org.apache.curator.x.discovery
Interface ServiceProviderBuilder<T>
-
public interface ServiceProviderBuilder<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ServiceProviderBuilder<T>
additionalFilter(InstanceFilter<T> filter)
Add an instance filter.ServiceProvider<T>
build()
Allocate a new service provider based on the current builder settingsServiceProviderBuilder<T>
downInstancePolicy(DownInstancePolicy downInstancePolicy)
Set the down instance policyServiceProviderBuilder<T>
providerStrategy(ProviderStrategy<T> providerStrategy)
optional - set the provider strategy.ServiceProviderBuilder<T>
serviceName(java.lang.String serviceName)
required - set the name of the service to be providedServiceProviderBuilder<T>
threadFactory(java.util.concurrent.ThreadFactory threadFactory)
optional - the thread factory to use for creating internal threads
-
-
-
Method Detail
-
build
ServiceProvider<T> build()
Allocate a new service provider based on the current builder settings- Returns:
- provider
-
serviceName
ServiceProviderBuilder<T> serviceName(java.lang.String serviceName)
required - set the name of the service to be provided- Parameters:
serviceName
- the name of the service- Returns:
- this
-
providerStrategy
ServiceProviderBuilder<T> providerStrategy(ProviderStrategy<T> providerStrategy)
optional - set the provider strategy. The default isRoundRobinStrategy
- Parameters:
providerStrategy
- strategy to use- Returns:
- this
-
threadFactory
ServiceProviderBuilder<T> threadFactory(java.util.concurrent.ThreadFactory threadFactory)
optional - the thread factory to use for creating internal threads- Parameters:
threadFactory
- factory to use- Returns:
- this
-
downInstancePolicy
ServiceProviderBuilder<T> downInstancePolicy(DownInstancePolicy downInstancePolicy)
Set the down instance policy- Parameters:
downInstancePolicy
- new policy- Returns:
- this
-
additionalFilter
ServiceProviderBuilder<T> additionalFilter(InstanceFilter<T> filter)
Add an instance filter. NOTE: this does not remove previously added filters. i.e. a l;ist is created of all added filters. Filters are called in the order they were added.- Parameters:
filter
- filter to add- Returns:
- this
-
-