Interface BlockingExecutor
- All Superinterfaces:
Executor
- All Known Subinterfaces:
BlockingExecutorService
- All Known Implementing Classes:
JBossThreadPoolExecutor, OrderedExecutor, QueueExecutor, QueuelessExecutor
Deprecated.
Executors in this package will always accept tasks immediately.
An executor which can optionally block or not block on task submission.
-
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.Executes the given command at some time in the future.voidexecuteBlocking(Runnable task) Deprecated.Execute a task, blocking until it can be accepted, or until the calling thread is interrupted.voidexecuteBlocking(Runnable task, long timeout, TimeUnit unit) Deprecated.Execute a task, blocking until it can be accepted, a timeout elapses, or the calling thread is interrupted.voidexecuteNonBlocking(Runnable task) Deprecated.Execute a task, without blocking.static BlockingExecutorDeprecated.Convert an executor to a "blocking" executor which never actually blocks.
-
Method Details
-
execute
Deprecated.Executes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the Executor implementation. The call may block or not block, depending on the configuration of the executor.- Specified by:
executein interfaceExecutor- Parameters:
task- the task to submit- Throws:
ExecutionInterruptedException- 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 isnull
-
executeBlocking
Deprecated.Execute a task, blocking until it can be accepted, or until the calling thread is interrupted.- Parameters:
task- the task to submit- Throws:
StoppedExecutorException- 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 isnull
-
executeBlocking
void executeBlocking(Runnable task, long timeout, TimeUnit unit) throws RejectedExecutionException, InterruptedException Deprecated.Execute a task, blocking until it can be accepted, a timeout elapses, or the calling thread is interrupted.- Parameters:
task- the task to submittimeout- the amount of time to waitunit- the unit of time- Throws:
ExecutionTimedOutException- 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 isnull
-
executeNonBlocking
Deprecated.Execute a task, without blocking.- Parameters:
task- the task to submit- Throws:
StoppedExecutorException- 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 isnull
-
of
Deprecated.Convert an executor to a "blocking" executor which never actually blocks.- Parameters:
executor- the executor (must not benull)- Returns:
- the blocking executor (not
null)
-