Package com.atlassian.jira.util
Class BoundedExecutorServiceWrapper
java.lang.Object
com.atlassian.jira.util.BoundedExecutorServiceWrapper
- All Implemented Interfaces:
ExecutorServiceWrapper
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.
- Since:
- v6.3
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanShutdown thread pool and block until it is drained using the configured timeout.booleanawaitTermination(long timeout, TimeUnit unit) Shutdown thread pool and block until it is drained.boolean<O> io.atlassian.util.concurrent.Promise<O>
-
Method Details
-
submit
- Specified by:
submitin interfaceExecutorServiceWrapper
-
awaitTermination
public boolean awaitTermination()Shutdown thread pool and block until it is drained using the configured timeout.- Specified by:
awaitTerminationin interfaceExecutorServiceWrapper- Returns:
- true if the executor service has been shutdown.
-
awaitTermination
Shutdown thread pool and block until it is drained.- Specified by:
awaitTerminationin interfaceExecutorServiceWrapper- Parameters:
timeout- the shutdown timeoutunit- the shutdown timeout unit- Returns:
- true if the executor service has been shutdown.
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceExecutorServiceWrapper
-