public final class

BoundedExecutorServiceWrapper

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

Class Overview

Wraps an ExecutorService to ensure the number of queued tasks is bounded to the specified concurrency. Submission of tasks will block until a thread is available. Construct using a BoundedExecutorServiceWrapper.Builder.

Summary

Nested Classes
class BoundedExecutorServiceWrapper.Builder  
Public Methods
boolean awaitTermination(long timeout, TimeUnit unit)
Shutdown thread pool and block until it is drained.
boolean awaitTermination()
Shutdown thread pool and block until it is drained using the configured timeout.
<O> Promise<O> submit(Callable<O> job)
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean awaitTermination (long timeout, TimeUnit unit)

Shutdown thread pool and block until it is drained.

Parameters
timeout the shutdown timeout
unit the shutdown timeout unit
Returns
  • true if the executor service has been shutdown.

public boolean awaitTermination ()

Shutdown thread pool and block until it is drained using the configured timeout.

Returns
  • true if the executor service has been shutdown.

public Promise<O> submit (Callable<O> job)