public static class

BoundedExecutorServiceWrapper.Builder

extends Object
java.lang.Object
   ↳ com.atlassian.jira.util.BoundedExecutorServiceWrapper.Builder

Summary

Public Constructors
BoundedExecutorServiceWrapper.Builder()
Public Methods
BoundedExecutorServiceWrapper build()
BoundedExecutorServiceWrapper.Builder withConcurrency(int concurrency)
Set the max number of concurrent operations supported by the ExecutorService
BoundedExecutorServiceWrapper.Builder withExecutorService(Supplier<ListeningExecutorService> executorServiceSupplier)
Provide a custom executor service supplier.
BoundedExecutorServiceWrapper.Builder withShutdownTimeout(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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BoundedExecutorServiceWrapper.Builder ()

Public Methods

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.

public BoundedExecutorServiceWrapper.Builder withExecutorService (Supplier<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.

public BoundedExecutorServiceWrapper.Builder withShutdownTimeout (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

public BoundedExecutorServiceWrapper.Builder withThreadPoolName (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