au.edu.jcu.hermes.core.common
Class SerialExecutorService

java.lang.Object
  extended by au.edu.jcu.hermes.core.common.SerialExecutorService
All Implemented Interfaces:
java.util.concurrent.Executor, java.util.concurrent.ExecutorService

public class SerialExecutorService
extends java.lang.Object
implements java.util.concurrent.ExecutorService

Author: Mathew Wyatt Organisation: James Cook University Date: Jan 31, 2008 Time: 12:39:41 PM

This class is used for executing code serialy rather than parallel, so that unit tests pass properly


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

Constructor Detail

SerialExecutorService

public SerialExecutorService()
Method Detail

shutdown

public void shutdown()
Specified by:
shutdown in interface java.util.concurrent.ExecutorService

shutdownNow

public java.util.List<java.lang.Runnable> shutdownNow()
Specified by:
shutdownNow in interface java.util.concurrent.ExecutorService

isShutdown

public boolean isShutdown()
Specified by:
isShutdown in interface java.util.concurrent.ExecutorService

isTerminated

public boolean isTerminated()
Specified by:
isTerminated in interface java.util.concurrent.ExecutorService

awaitTermination

public boolean awaitTermination(long l,
                                java.util.concurrent.TimeUnit timeUnit)
                         throws java.lang.InterruptedException
Specified by:
awaitTermination in interface java.util.concurrent.ExecutorService
Throws:
java.lang.InterruptedException

submit

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

submit

public <T> java.util.concurrent.Future<T> submit(java.lang.Runnable runnable,
                                                 T t)
Specified by:
submit in interface java.util.concurrent.ExecutorService

submit

public java.util.concurrent.Future<?> submit(java.lang.Runnable runnable)
Specified by:
submit in interface java.util.concurrent.ExecutorService

invokeAll

public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<java.util.concurrent.Callable<T>> callables)
                                                         throws java.lang.InterruptedException
Specified by:
invokeAll in interface java.util.concurrent.ExecutorService
Throws:
java.lang.InterruptedException

invokeAll

public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<java.util.concurrent.Callable<T>> callables,
                                                                    long l,
                                                                    java.util.concurrent.TimeUnit timeUnit)
                                                         throws java.lang.InterruptedException
Specified by:
invokeAll in interface java.util.concurrent.ExecutorService
Throws:
java.lang.InterruptedException

invokeAny

public <T> T invokeAny(java.util.Collection<java.util.concurrent.Callable<T>> callables)
            throws java.lang.InterruptedException,
                   java.util.concurrent.ExecutionException
Specified by:
invokeAny in interface java.util.concurrent.ExecutorService
Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException

invokeAny

public <T> T invokeAny(java.util.Collection<java.util.concurrent.Callable<T>> callables,
                       long l,
                       java.util.concurrent.TimeUnit timeUnit)
            throws java.lang.InterruptedException,
                   java.util.concurrent.ExecutionException,
                   java.util.concurrent.TimeoutException
Specified by:
invokeAny in interface java.util.concurrent.ExecutorService
Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException

execute

public void execute(java.lang.Runnable runnable)
Specified by:
execute in interface java.util.concurrent.Executor