JBoss Threads 2.0.0.GA

org.jboss.threads
Interface BlockingExecutor

All Superinterfaces:
Executor
All Known Subinterfaces:
BlockingExecutorService
All Known Implementing Classes:
JBossThreadPoolExecutor, OrderedExecutor, QueueExecutor, QueuelessExecutor

public interface BlockingExecutor
extends Executor

An executor which can optionally block or not block on task submission.


Method Summary
 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.
 

Method Detail

execute

void execute(Runnable task)
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:
execute in interface Executor
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 accepted
StoppedExecutorException - if the executor was shut down before the task was accepted
ThreadCreationException - if a thread could not be created for some reason
RejectedExecutionException - if execution is rejected for some other reason
NullPointerException - if command is null

executeBlocking

void executeBlocking(Runnable task)
                     throws RejectedExecutionException,
                            InterruptedException
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 accepted
ThreadCreationException - if a thread could not be created for some reason
RejectedExecutionException - if execution is rejected for some other reason
InterruptedException - if the current thread was interrupted before the task could be accepted
NullPointerException - if command is null

executeBlocking

void executeBlocking(Runnable task,
                     long timeout,
                     TimeUnit unit)
                     throws RejectedExecutionException,
                            InterruptedException
Execute a task, blocking until it can be accepted, a timeout elapses, or the calling thread is interrupted.

Parameters:
task - the task to submit
timeout - the amount of time to wait
unit - the unit of time
Throws:
ExecutionTimedOutException - if the timeout elapsed before a task could be accepted
StoppedExecutorException - if the executor was shut down before the task was accepted
ThreadCreationException - if a thread could not be created for some reason
RejectedExecutionException - if execution is rejected for some other reason
InterruptedException - if the current thread was interrupted before the task could be accepted
NullPointerException - if command is null

executeNonBlocking

void executeNonBlocking(Runnable task)
                        throws RejectedExecutionException
Execute a task, without blocking.

Parameters:
task - the task to submit
Throws:
StoppedExecutorException - if the executor was shut down before the task was accepted
ThreadCreationException - if a thread could not be created for some reason
RejectedExecutionException - if execution is rejected for some other reason
NullPointerException - if command is null

JBoss Threads 2.0.0.GA

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.