public class BlockingTaskAwareExecutorServiceImpl extends AbstractExecutorService implements BlockingTaskAwareExecutorService
BlockingRunnable
. This special runnable gives hints about the code
to be running in order to avoiding put a runnable that will block the thread. In this way, only when the runnable
says that is ready, it is sent to the real executor serviceConstructor and Description |
---|
BlockingTaskAwareExecutorServiceImpl(ExecutorService executorService,
TimeService timeService) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
void |
checkForReadyTasks()
It checks for tasks ready to be processed in this
ExecutorService . |
void |
execute(BlockingRunnable runnable)
Executes the given command at some time in the future when the command is less probably to block a thread.
|
void |
execute(Runnable command) |
ExecutorService |
getExecutorService() |
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
shutdown() |
List<Runnable> |
shutdownNow() |
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
public BlockingTaskAwareExecutorServiceImpl(ExecutorService executorService, TimeService timeService)
public final void execute(BlockingRunnable runnable)
BlockingTaskAwareExecutorService
execute
in interface BlockingTaskAwareExecutorService
runnable
- the command to executepublic void shutdown()
shutdown
in interface ExecutorService
public List<Runnable> shutdownNow()
shutdownNow
in interface ExecutorService
public boolean isShutdown()
isShutdown
in interface ExecutorService
public boolean isTerminated()
isTerminated
in interface ExecutorService
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
awaitTermination
in interface ExecutorService
InterruptedException
public final void checkForReadyTasks()
BlockingTaskAwareExecutorService
ExecutorService
.
The invocation is done asynchronously, so the invoker is never blocked.checkForReadyTasks
in interface BlockingTaskAwareExecutorService
public ExecutorService getExecutorService()
Copyright © 2021 JBoss by Red Hat. All rights reserved.