public final class ResilientExecutionUtil extends Object
ResetByChunksRollingHdrHistogramImpl.
For background execution this class maintains own implementation of executor SingleThreadExecutor
which extremely fast and has no blocking on task queueing.| Modifier and Type | Method and Description |
|---|---|
void |
execute(Executor executor,
Runnable task)
Executes task on executor.
|
Executor |
getBackgroundExecutor() |
static ResilientExecutionUtil |
getInstance() |
void |
setThreadFactory(ThreadFactory threadFactory)
Sets the thread threadFactory which will be used for construction of
SingleThreadExecutor. |
void |
shutdownBackgroundExecutor()
If the
getBackgroundExecutor() was called before, the this method perform shutdown of background execution thread. |
public static ResilientExecutionUtil getInstance()
ResilientExecutionUtilpublic void execute(Executor executor, Runnable task)
executor - task - public Executor getBackgroundExecutor()
SingleThreadExecutorpublic void shutdownBackgroundExecutor()
getBackgroundExecutor() was called before, the this method perform shutdown of background execution thread.public void setThreadFactory(ThreadFactory threadFactory)
SingleThreadExecutor.
This method should be called strongly before first invocation of getBackgroundExecutor().
This method is designed to be used in restricted environments with enabled SecurityManager,
when creation of new thread can fail by security limitation.
Normally, you should not use this method, because DEFAULT_THREAD_FACTORY is quit enough.
threadFactory - IllegalStateException - if executor already createdCopyright © 2020. All rights reserved.