public static class BoundedExecutorServiceWrapper.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
BoundedExecutorServiceWrapper |
build() |
BoundedExecutorServiceWrapper.Builder |
withConcurrency(int concurrency)
Set the max number of concurrent operations supported by the ExecutorService
|
BoundedExecutorServiceWrapper.Builder |
withExecutorService(Supplier<com.google.common.util.concurrent.ListeningExecutorService> executorServiceSupplier)
Provide a custom executor service supplier.
|
BoundedExecutorServiceWrapper.Builder |
withShutdownTimeout(org.joda.time.Duration shutdownTimeout)
Set the timeout duration for shutting down the executor service.
|
BoundedExecutorServiceWrapper.Builder |
withThreadPoolName(String threadPoolName)
Set the thread pool name used by the executor service that is managed by the wrapper.
|
public BoundedExecutorServiceWrapper.Builder withConcurrency(int concurrency)
concurrency
- The max number of concurrent operations.public BoundedExecutorServiceWrapper.Builder withShutdownTimeout(@Nonnull org.joda.time.Duration shutdownTimeout)
shutdownTimeout
- The timeout duration for shutting down the executor service.public BoundedExecutorServiceWrapper.Builder withThreadPoolName(@Nonnull String threadPoolName)
withExecutorService(Supplier)
.threadPoolName
- The thread pool namepublic BoundedExecutorServiceWrapper.Builder withExecutorService(@Nonnull Supplier<com.google.common.util.concurrent.ListeningExecutorService> executorServiceSupplier)
executorServiceSupplier
- Supplier of a suitable executor service to usepublic BoundedExecutorServiceWrapper build()
Copyright © 2002-2022 Atlassian. All Rights Reserved.