Class BoundedExecutorServiceWrapper.Builder

java.lang.Object
com.atlassian.jira.util.BoundedExecutorServiceWrapper.Builder
Enclosing class:
BoundedExecutorServiceWrapper

public static class BoundedExecutorServiceWrapper.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withConcurrency

      public BoundedExecutorServiceWrapper.Builder withConcurrency(int concurrency)
      Set the max number of concurrent operations supported by the ExecutorService
      Parameters:
      concurrency - The max number of concurrent operations.
      Returns:
      a configured builder.
    • withShutdownTimeout

      public BoundedExecutorServiceWrapper.Builder withShutdownTimeout(@Nonnull org.joda.time.Duration shutdownTimeout)
      Set the timeout duration for shutting down the executor service.
      Parameters:
      shutdownTimeout - The timeout duration for shutting down the executor service.
      Returns:
      a configured builder
    • withThreadPoolName

      public BoundedExecutorServiceWrapper.Builder withThreadPoolName(@Nonnull String threadPoolName)
      Set the thread pool name used by the executor service that is managed by the wrapper. This setting cannot be used with withExecutorService(Supplier).
      Parameters:
      threadPoolName - The thread pool name
      Returns:
      a configured builder
    • withExecutorService

      public BoundedExecutorServiceWrapper.Builder withExecutorService(@Nonnull Supplier<com.google.common.util.concurrent.ListeningExecutorService> executorServiceSupplier)
      Provide a custom executor service supplier. This setting cannot be used with the thread pool name setting. NB A cached thread pool is recommended as the executor service.
      Parameters:
      executorServiceSupplier - Supplier of a suitable executor service to use
      Returns:
      a builder configured with the supplier.
    • build