Interface ServiceProviderBuilder<T>


public interface ServiceProviderBuilder<T>
  • Method Details

    • build

      ServiceProvider<T> build()
      Allocate a new service provider based on the current builder settings
      Returns:
      provider
    • serviceName

      ServiceProviderBuilder<T> serviceName(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 is RoundRobinStrategy
      Parameters:
      providerStrategy - strategy to use
      Returns:
      this
    • threadFactory

      @Deprecated ServiceProviderBuilder<T> threadFactory(ThreadFactory threadFactory)
      Deprecated.
      optional - the thread factory to use for creating internal threads. The specified ThreadFactory overrides any prior ThreadFactory or ClosableExecutorService set on the ServiceProviderBuilder
      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 list is created of all added filters. Filters are called in the order they were added.
      Parameters:
      filter - filter to add
      Returns:
      this
    • executorService

      ServiceProviderBuilder<T> executorService(ExecutorService executorService)
      Optional ExecutorService to use for the cache's background thread. The specified ExecutorService will be wrapped in a CloseableExecutorService and overrides any prior ThreadFactory or CloseableExecutorService set on the ServiceProviderBuilder.
      Parameters:
      executorService - executor service
      Returns:
      this