public interface BlockingExecutor extends Executor
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable task)
Executes the given command at some time in the future.
|
void |
executeBlocking(Runnable task)
Execute a task, blocking until it can be accepted, or until the calling thread is interrupted.
|
void |
executeBlocking(Runnable task,
long timeout,
TimeUnit unit)
Execute a task, blocking until it can be accepted, a timeout elapses, or the calling thread is interrupted.
|
void |
executeNonBlocking(Runnable task)
Execute a task, without blocking.
|
void execute(Runnable task)
execute
in interface Executor
task
- the task to submitExecutionInterruptedException
- if the executor is configured to block, and the thread was interrupted while waiting
for the task to be acceptedStoppedExecutorException
- if the executor was shut down before the task was acceptedThreadCreationException
- if a thread could not be created for some reasonRejectedExecutionException
- if execution is rejected for some other reasonNullPointerException
- if command is null
void executeBlocking(Runnable task) throws RejectedExecutionException, InterruptedException
task
- the task to submitStoppedExecutorException
- if the executor was shut down before the task was acceptedThreadCreationException
- if a thread could not be created for some reasonRejectedExecutionException
- if execution is rejected for some other reasonInterruptedException
- if the current thread was interrupted before the task could be acceptedNullPointerException
- if command is null
void executeBlocking(Runnable task, long timeout, TimeUnit unit) throws RejectedExecutionException, InterruptedException
task
- the task to submittimeout
- the amount of time to waitunit
- the unit of timeExecutionTimedOutException
- if the timeout elapsed before a task could be acceptedStoppedExecutorException
- if the executor was shut down before the task was acceptedThreadCreationException
- if a thread could not be created for some reasonRejectedExecutionException
- if execution is rejected for some other reasonInterruptedException
- if the current thread was interrupted before the task could be acceptedNullPointerException
- if command is null
void executeNonBlocking(Runnable task) throws RejectedExecutionException
task
- the task to submitStoppedExecutorException
- if the executor was shut down before the task was acceptedThreadCreationException
- if a thread could not be created for some reasonRejectedExecutionException
- if execution is rejected for some other reasonNullPointerException
- if command is null
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.