Package java.util.concurrent

Interface Summary
BlockingQueue<E> sample code for java.util.concurrent.BlockingQueue definition code for java.util.concurrent.BlockingQueue A Queue sample code for java.util.Queue definition code for java.util.Queue that additionally supports operations that wait for the queue to become non-empty when retrieving an element, and wait for space to become available in the queue when storing an element.
Callable<V> sample code for java.util.concurrent.Callable definition code for java.util.concurrent.Callable A task that returns a result and may throw an exception.
CompletionService<V> sample code for java.util.concurrent.CompletionService definition code for java.util.concurrent.CompletionService A service that decouples the production of new asynchronous tasks from the consumption of the results of completed tasks.
ConcurrentMap<K,V> sample code for java.util.concurrent.ConcurrentMap definition code for java.util.concurrent.ConcurrentMap A Map sample code for java.util.Map definition code for java.util.Map providing additional atomic putIfAbsent, remove, and replace methods.
Delayed sample code for java.util.concurrent.Delayed definition code for java.util.concurrent.Delayed A mix-in style interface for marking objects that should be acted upon after a given delay.
Executor sample code for java.util.concurrent.Executor definition code for java.util.concurrent.Executor An object that executes submitted Runnable sample code for java.lang.Runnable definition code for java.lang.Runnable tasks.
ExecutorService sample code for java.util.concurrent.ExecutorService definition code for java.util.concurrent.ExecutorService An Executor sample code for java.util.concurrent.Executor definition code for java.util.concurrent.Executor that provides methods to manage termination and methods that can produce a Future sample code for java.util.concurrent.Future definition code for java.util.concurrent.Future for tracking progress of one or more asynchronous tasks.
Future<V> sample code for java.util.concurrent.Future definition code for java.util.concurrent.Future A Future represents the result of an asynchronous computation.
RejectedExecutionHandler sample code for java.util.concurrent.RejectedExecutionHandler definition code for java.util.concurrent.RejectedExecutionHandler A handler for tasks that cannot be executed by a ThreadPoolExecutor sample code for java.util.concurrent.ThreadPoolExecutor definition code for java.util.concurrent.ThreadPoolExecutor .
ScheduledExecutorService sample code for java.util.concurrent.ScheduledExecutorService definition code for java.util.concurrent.ScheduledExecutorService An ExecutorService sample code for java.util.concurrent.ExecutorService definition code for java.util.concurrent.ExecutorService that can schedule commands to run after a given delay, or to execute periodically.
ScheduledFuture<V> sample code for java.util.concurrent.ScheduledFuture definition code for java.util.concurrent.ScheduledFuture A delayed result-bearing action that can be cancelled.
ThreadFactory sample code for java.util.concurrent.ThreadFactory definition code for java.util.concurrent.ThreadFactory An object that creates new threads on demand.
 

Class Summary
AbstractExecutorService sample code for java.util.concurrent.AbstractExecutorService definition code for java.util.concurrent.AbstractExecutorService Provides default implementation of ExecutorService sample code for java.util.concurrent.ExecutorService definition code for java.util.concurrent.ExecutorService execution methods.
ArrayBlockingQueue<E> sample code for java.util.concurrent.ArrayBlockingQueue definition code for java.util.concurrent.ArrayBlockingQueue A bounded blocking queue sample code for java.util.concurrent.BlockingQueue definition code for java.util.concurrent.BlockingQueue backed by an array.
ConcurrentHashMap<K,V> sample code for java.util.concurrent.ConcurrentHashMap definition code for java.util.concurrent.ConcurrentHashMap A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updates.
ConcurrentLinkedQueue<E> sample code for java.util.concurrent.ConcurrentLinkedQueue definition code for java.util.concurrent.ConcurrentLinkedQueue An unbounded thread-safe queue sample code for java.util.Queue definition code for java.util.Queue based on linked nodes.
CopyOnWriteArrayList<E> sample code for java.util.concurrent.CopyOnWriteArrayList definition code for java.util.concurrent.CopyOnWriteArrayList A thread-safe variant of ArrayList sample code for java.util.ArrayList definition code for java.util.ArrayList in which all mutative operations (add, set, and so on) are implemented by making a fresh copy of the underlying array.
CopyOnWriteArraySet<E> sample code for java.util.concurrent.CopyOnWriteArraySet definition code for java.util.concurrent.CopyOnWriteArraySet A Set sample code for java.util.Set definition code for java.util.Set that uses CopyOnWriteArrayList sample code for java.util.concurrent.CopyOnWriteArrayList definition code for java.util.concurrent.CopyOnWriteArrayList for all of its operations.
CountDownLatch sample code for java.util.concurrent.CountDownLatch definition code for java.util.concurrent.CountDownLatch A synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes.
CyclicBarrier sample code for java.util.concurrent.CyclicBarrier definition code for java.util.concurrent.CyclicBarrier A synchronization aid that allows a set of threads to all wait for each other to reach a common barrier point.
DelayQueue<E extends Delayed> sample code for java.util.concurrent.DelayQueue definition code for java.util.concurrent.DelayQueue An unbounded blocking queue sample code for java.util.concurrent.BlockingQueue definition code for java.util.concurrent.BlockingQueue of Delayed elements, in which an element can only be taken when its delay has expired.
Exchanger<V> sample code for java.util.concurrent.Exchanger definition code for java.util.concurrent.Exchanger A synchronization point at which two threads can exchange objects.
ExecutorCompletionService<V> sample code for java.util.concurrent.ExecutorCompletionService definition code for java.util.concurrent.ExecutorCompletionService A CompletionService sample code for java.util.concurrent.CompletionService definition code for java.util.concurrent.CompletionService that uses a supplied Executor sample code for java.util.concurrent.Executor definition code for java.util.concurrent.Executor to execute tasks.
Executors sample code for java.util.concurrent.Executors definition code for java.util.concurrent.Executors Factory and utility methods for Executor sample code for java.util.concurrent.Executor definition code for java.util.concurrent.Executor , ExecutorService sample code for java.util.concurrent.ExecutorService definition code for java.util.concurrent.ExecutorService , ScheduledExecutorService sample code for java.util.concurrent.ScheduledExecutorService definition code for java.util.concurrent.ScheduledExecutorService , ThreadFactory sample code for java.util.concurrent.ThreadFactory definition code for java.util.concurrent.ThreadFactory , and Callable sample code for java.util.concurrent.Callable definition code for java.util.concurrent.Callable classes defined in this package.
FutureTask<V> sample code for java.util.concurrent.FutureTask definition code for java.util.concurrent.FutureTask A cancellable asynchronous computation.
LinkedBlockingQueue<E> sample code for java.util.concurrent.LinkedBlockingQueue definition code for java.util.concurrent.LinkedBlockingQueue An optionally-bounded blocking queue sample code for java.util.concurrent.BlockingQueue definition code for java.util.concurrent.BlockingQueue based on linked nodes.
PriorityBlockingQueue<E> sample code for java.util.concurrent.PriorityBlockingQueue definition code for java.util.concurrent.PriorityBlockingQueue An unbounded blocking queue sample code for java.util.concurrent.BlockingQueue definition code for java.util.concurrent.BlockingQueue that uses the same ordering rules as class PriorityQueue sample code for java.util.PriorityQueue definition code for java.util.PriorityQueue and supplies blocking retrieval operations.
ScheduledThreadPoolExecutor sample code for java.util.concurrent.ScheduledThreadPoolExecutor definition code for java.util.concurrent.ScheduledThreadPoolExecutor A ThreadPoolExecutor sample code for java.util.concurrent.ThreadPoolExecutor definition code for java.util.concurrent.ThreadPoolExecutor that can additionally schedule commands to run after a given delay, or to execute periodically.
Semaphore sample code for java.util.concurrent.Semaphore definition code for java.util.concurrent.Semaphore A counting semaphore.
SynchronousQueue<E> sample code for java.util.concurrent.SynchronousQueue definition code for java.util.concurrent.SynchronousQueue A blocking queue sample code for java.util.concurrent.BlockingQueue definition code for java.util.concurrent.BlockingQueue in which each put must wait for a take, and vice versa.
ThreadPoolExecutor sample code for java.util.concurrent.ThreadPoolExecutor definition code for java.util.concurrent.ThreadPoolExecutor An ExecutorService sample code for java.util.concurrent.ExecutorService definition code for java.util.concurrent.ExecutorService that executes each submitted task using one of possibly several pooled threads, normally configured using Executors sample code for java.util.concurrent.Executors definition code for java.util.concurrent.Executors factory methods.
ThreadPoolExecutor.AbortPolicy sample code for java.util.concurrent.ThreadPoolExecutor.AbortPolicy definition code for java.util.concurrent.ThreadPoolExecutor.AbortPolicy A handler for rejected tasks that throws a RejectedExecutionException.
ThreadPoolExecutor.CallerRunsPolicy sample code for java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy definition code for java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy A handler for rejected tasks that runs the rejected task directly in the calling thread of the execute method, unless the executor has been shut down, in which case the task is discarded.
ThreadPoolExecutor.DiscardOldestPolicy sample code for java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy definition code for java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy A handler for rejected tasks that discards the oldest unhandled request and then retries execute, unless the executor is shut down, in which case the task is discarded.
ThreadPoolExecutor.DiscardPolicy sample code for java.util.concurrent.ThreadPoolExecutor.DiscardPolicy definition code for java.util.concurrent.ThreadPoolExecutor.DiscardPolicy A handler for rejected tasks that silently discards the rejected task.
 

Enum Summary
TimeUnit sample code for java.util.concurrent.TimeUnit definition code for java.util.concurrent.TimeUnit A TimeUnit represents time durations at a given unit of granularity and provides utility methods to convert across units, and to perform timing and delay operations in these units.
 

Exception Summary
BrokenBarrierException sample code for java.util.concurrent.BrokenBarrierException definition code for java.util.concurrent.BrokenBarrierException Exception thrown when a thread tries to wait upon a barrier that is in a broken state, or which enters the broken state while the thread is waiting.
CancellationException sample code for java.util.concurrent.CancellationException definition code for java.util.concurrent.CancellationException Exception indicating that the result of a value-producing task, such as a FutureTask sample code for java.util.concurrent.FutureTask definition code for java.util.concurrent.FutureTask , cannot be retrieved because the task was cancelled.
ExecutionException sample code for java.util.concurrent.ExecutionException definition code for java.util.concurrent.ExecutionException Exception thrown when attempting to retrieve the result of a task that aborted by throwing an exception.
RejectedExecutionException sample code for java.util.concurrent.RejectedExecutionException definition code for java.util.concurrent.RejectedExecutionException Exception thrown by an Executor sample code for java.util.concurrent.Executor definition code for java.util.concurrent.Executor when a task cannot be accepted for execution.
TimeoutException sample code for java.util.concurrent.TimeoutException definition code for java.util.concurrent.TimeoutException Exception thrown when a blocking operation times out.