Package org.apache.curator.x.discovery
Interface ServiceCacheBuilder<T>
-
public interface ServiceCacheBuilder<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ServiceCache<T>
build()
Return a new service cache with the current settingsServiceCacheBuilder<T>
executorService(java.util.concurrent.ExecutorService executorService)
Optional ExecutorService to use for the cache's background thread.ServiceCacheBuilder<T>
executorService(org.apache.curator.utils.CloseableExecutorService executorService)
Optional CloseableExecutorService to use for the cache's background thread.ServiceCacheBuilder<T>
name(java.lang.String name)
The name of the service to cache (required)ServiceCacheBuilder<T>
threadFactory(java.util.concurrent.ThreadFactory threadFactory)
Optional thread factory to use for the cache's internal thread.
-
-
-
Method Detail
-
build
ServiceCache<T> build()
Return a new service cache with the current settings- Returns:
- service cache
-
name
ServiceCacheBuilder<T> name(java.lang.String name)
The name of the service to cache (required)- Parameters:
name
- service name- Returns:
- this
-
threadFactory
ServiceCacheBuilder<T> threadFactory(java.util.concurrent.ThreadFactory threadFactory)
Optional thread factory to use for the cache's internal thread. The specified ExecutorService overrides any prior ThreadFactory or ExecutorService set on the ServiceCacheBuilder.- Parameters:
threadFactory
- factory- Returns:
- this
-
executorService
ServiceCacheBuilder<T> executorService(java.util.concurrent.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 ExecutorService set on the ServiceCacheBuilder.- Parameters:
executorService
- executor service- Returns:
- this
-
executorService
ServiceCacheBuilder<T> executorService(org.apache.curator.utils.CloseableExecutorService executorService)
Optional CloseableExecutorService to use for the cache's background thread. The specified ExecutorService overrides any prior ThreadFactory or ExecutorService set on the ServiceCacheBuilder.- Parameters:
executorService
- an instance of CloseableExecutorService- Returns:
- this
-
-