org.apache.camel.util.concurrent
Class SynchronousExecutorService

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by org.apache.camel.util.concurrent.SynchronousExecutorService
All Implemented Interfaces:
Executor, ExecutorService

public class SynchronousExecutorService
extends AbstractExecutorService

A synchronous ExecutorService which always invokes the task in the caller thread (just a thread pool facade).

There is no task queue, and no thread pool. The task will thus always be executed by the caller thread in a fully synchronous method invocation.

This implementation is very simple and does not support waiting for tasks to complete during shutdown.

Version:

Constructor Summary
SynchronousExecutorService()
           
 
Method Summary
 boolean awaitTermination(long time, TimeUnit unit)
           
 void execute(Runnable runnable)
           
 boolean isShutdown()
           
 boolean isTerminated()
           
 void shutdown()
           
 List<Runnable> shutdownNow()
           
 
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchronousExecutorService

public SynchronousExecutorService()
Method Detail

shutdown

public void shutdown()

shutdownNow

public List<Runnable> shutdownNow()

isShutdown

public boolean isShutdown()

isTerminated

public boolean isTerminated()

awaitTermination

public boolean awaitTermination(long time,
                                TimeUnit unit)
                         throws InterruptedException
Throws:
InterruptedException

execute

public void execute(Runnable runnable)


Apache CAMEL