Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.emory.mathcs.util.concurrent
Class ThreadSerializingExecutor  view ThreadSerializingExecutor download ThreadSerializingExecutor.java

java.lang.Object
  extended byedu.emory.mathcs.util.concurrent.ThreadSerializingExecutor
All Implemented Interfaces:
Executor

public class ThreadSerializingExecutor
extends java.lang.Object
implements Executor

The executor that delegates to other executor (usually pooling executor) but ensures that tasks scheduled from a single thread are executed sequentially.

Version:
1.0

Nested Class Summary
private static class ThreadSerializingExecutor.TaskQueue
           
 
Field Summary
(package private)  Executor pool
           
(package private)  java.lang.ThreadLocal queue
           
 
Constructor Summary
ThreadSerializingExecutor(Executor pool)
          Creates a new thread serializing executor that delegates to the specified executor.
 
Method Summary
 void execute(java.lang.Runnable runnable)
          Executes the given command at some time in the future.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pool

final Executor pool

queue

final java.lang.ThreadLocal queue
Constructor Detail

ThreadSerializingExecutor

public ThreadSerializingExecutor(Executor pool)
Creates a new thread serializing executor that delegates to the specified executor.

Method Detail

execute

public void execute(java.lang.Runnable runnable)
Description copied from interface: Executor
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.

Specified by:
execute in interface Executor