public interface ExecutorBuilder<E extends java.util.concurrent.ExecutorService>
ThreadPoolExecutorBuilder
Modifier and Type | Method and Description |
---|---|
E |
build()
Build the configured executor
|
ExecutorBuilder<E> |
withDefaultThreadGroup()
Use the system default thread group for the threads we create.
|
ExecutorBuilder<E> |
withKeepAlive()
Core threads for the executor built by this factory will never timeout (default for single threaded builders).
|
ExecutorBuilder<E> |
withKeepAlive(long keepAlive,
java.util.concurrent.TimeUnit keepAliveUnits)
Threads for the executor built by this factory will timeout (terminate) after the specified period.
|
ExecutorBuilder<E> |
withQueueLimit(int queueLimit)
The executor built by this factory will limit the number of queued tasks; default is unlimited.
|
ExecutorBuilder<E> |
withRejectedExecutionHandler(java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler)
Set the
RejectedExecutionHandler for the executor built by this factory. |
ExecutorBuilder<E> |
withThreadGroup(java.lang.ThreadGroup threadGroup)
Threads for the executor built by this factory will all be (transitively) members of
threadGroup ,
but may directly reside in a child thread group. |
ExecutorBuilder<E> |
withThreadPriority(int threadPriority)
Specify the priority of threads that service the executor built by this factory (default to
Thread.NORM_PRIORITY ) |
ExecutorBuilder<E> |
withUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Set the
Thread.UncaughtExceptionHandler for threads that service executors built by this factory. |
ExecutorBuilder<E> withKeepAlive(long keepAlive, java.util.concurrent.TimeUnit keepAliveUnits)
ExecutorBuilder<E> withKeepAlive()
ExecutorBuilder<E> withThreadPriority(int threadPriority)
Thread.NORM_PRIORITY
)ExecutorBuilder<E> withThreadGroup(java.lang.ThreadGroup threadGroup)
threadGroup
,
but may directly reside in a child thread group.ExecutorBuilder<E> withDefaultThreadGroup()
ExecutorBuilder<E> withQueueLimit(int queueLimit)
withRejectedExecutionHandler(RejectedExecutionHandler)
)ExecutorBuilder<E> withRejectedExecutionHandler(java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler)
RejectedExecutionHandler
for the executor built by this factory.
By default this is executor-specific, either:
ThreadPoolExecutorBase.blockingExecutionHandler
ScheduledThreadPoolExecutorPlus.rejectedExecutionHandler
ThreadPoolExecutorJMXAdapter.rejectedExecutionHandler(org.apache.cassandra.metrics.ThreadPoolMetrics, java.util.concurrent.RejectedExecutionHandler)
ExecutorBuilder<E> withUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Thread.UncaughtExceptionHandler
for threads that service executors built by this factory.
By default JVMStabilityInspector.uncaughtException(Thread, Throwable)
E build()
Copyright © 2009- The Apache Software Foundation