public final class

BoundedExecutorServiceWrapper

extends Object
implements ExecutorServiceWrapper
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()
Shutdown thread pool and block until it is drained using the configured timeout.
boolean awaitTermination(long timeout, TimeUnit unit)
Shutdown thread pool and block until it is drained.
boolean isTerminated()
<O> Promise<O> submit(Callable<O> job)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.util.ExecutorServiceWrapper

Public Methods

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 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 isTerminated ()

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