compbio.engine.local
Class LocalExecutorService

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by compbio.engine.local.LocalExecutorService
All Implemented Interfaces:
Executor, ExecutorService

public final class LocalExecutorService
extends ThreadPoolExecutor


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
 
Method Summary
 boolean canAcceptMoreWork()
          If the Executor queue is empty
static LocalExecutorService getExecutor()
          This method returns the single instance of CachedThreadPoolExecutor which it cashes internally
static void shutDown()
          This stops all executing processes via interruption.
 
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow
 
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getExecutor

public static LocalExecutorService getExecutor()
This method returns the single instance of CachedThreadPoolExecutor which it cashes internally

Returns:
the instance

shutDown

public static void shutDown()
This stops all executing processes via interruption. Thus it is vital that all processes that use this service respond to interruption Stops internal executor service which captures streams of native executables. This method is intended for stopping service if deployed in the web application context. There is NO NEED of using this method otherwise as the executor service is taken care of internally.


canAcceptMoreWork

public boolean canAcceptMoreWork()
If the Executor queue is empty

Returns:
true is not all threads are busy, false otherwise