org.atmosphere.util
Class VoidExecutorService

java.lang.Object
  extended by org.atmosphere.util.VoidExecutorService
All Implemented Interfaces:
Executor, ExecutorService

public class VoidExecutorService
extends Object
implements ExecutorService

An ExecutorService that does nothing and execute using the calling Thread.


Field Summary
static VoidExecutorService VOID
           
 
Constructor Summary
VoidExecutorService()
           
 
Method Summary
 boolean awaitTermination(long l, TimeUnit timeUnit)
           
 void execute(Runnable runnable)
           
<T> List<Future<T>>
invokeAll(Collection<? extends Callable<T>> callables)
           
<T> List<Future<T>>
invokeAll(Collection<? extends Callable<T>> callables, long l, TimeUnit timeUnit)
           
<T> T
invokeAny(Collection<? extends Callable<T>> callables)
           
<T> T
invokeAny(Collection<? extends Callable<T>> callables, long l, TimeUnit timeUnit)
           
 boolean isShutdown()
           
 boolean isTerminated()
           
 void shutdown()
           
 List<Runnable> shutdownNow()
           
<T> Future<T>
submit(Callable<T> tCallable)
           
 Future<?> submit(Runnable runnable)
           
<T> Future<T>
submit(Runnable runnable, T t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VOID

public static final VoidExecutorService VOID
Constructor Detail

VoidExecutorService

public VoidExecutorService()
Method Detail

shutdown

public void shutdown()
Specified by:
shutdown in interface ExecutorService

shutdownNow

public List<Runnable> shutdownNow()
Specified by:
shutdownNow in interface ExecutorService

isShutdown

public boolean isShutdown()
Specified by:
isShutdown in interface ExecutorService

isTerminated

public boolean isTerminated()
Specified by:
isTerminated in interface ExecutorService

awaitTermination

public boolean awaitTermination(long l,
                                TimeUnit timeUnit)
                         throws InterruptedException
Specified by:
awaitTermination in interface ExecutorService
Throws:
InterruptedException

submit

public <T> Future<T> submit(Callable<T> tCallable)
Specified by:
submit in interface ExecutorService

submit

public <T> Future<T> submit(Runnable runnable,
                            T t)
Specified by:
submit in interface ExecutorService

submit

public Future<?> submit(Runnable runnable)
Specified by:
submit in interface ExecutorService

invokeAll

public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> callables)
                          throws InterruptedException
Specified by:
invokeAll in interface ExecutorService
Throws:
InterruptedException

invokeAll

public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> callables,
                                     long l,
                                     TimeUnit timeUnit)
                          throws InterruptedException
Specified by:
invokeAll in interface ExecutorService
Throws:
InterruptedException

invokeAny

public <T> T invokeAny(Collection<? extends Callable<T>> callables)
            throws InterruptedException,
                   ExecutionException
Specified by:
invokeAny in interface ExecutorService
Throws:
InterruptedException
ExecutionException

invokeAny

public <T> T invokeAny(Collection<? extends Callable<T>> callables,
                       long l,
                       TimeUnit timeUnit)
            throws InterruptedException,
                   ExecutionException,
                   TimeoutException
Specified by:
invokeAny in interface ExecutorService
Throws:
InterruptedException
ExecutionException
TimeoutException

execute

public void execute(Runnable runnable)
Specified by:
execute in interface Executor


Copyright © 2012. All Rights Reserved.