edu.uci.jforests.util.concurrency
Class BlockingThreadPoolExecutor
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- edu.uci.jforests.util.concurrency.BlockingThreadPoolExecutor
-
- All Implemented Interfaces:
- java.util.concurrent.Executor, java.util.concurrent.ExecutorService
public class BlockingThreadPoolExecutor extends java.util.concurrent.ThreadPoolExecutorThis is a blocking version of Java's ThreadPoolExecutor. It makes sure that the number of concurrently running threads does not exceed the poolSize. This code is based on ideas presented at: http://today.java.net/pub/a/today/2008/10/23/creating-a-notifying-blocking-thread-pool-executor.html
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidawait()voidexecute(java.lang.Runnable task)static BlockingThreadPoolExecutorgetInstance()static voidinit(int poolSize)-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, 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, toString
-
-
-
-
Method Detail
-
init
public static void init(int poolSize)
-
getInstance
public static BlockingThreadPoolExecutor getInstance()
-
execute
public void execute(java.lang.Runnable task)
- Specified by:
executein interfacejava.util.concurrent.Executor- Overrides:
executein classjava.util.concurrent.ThreadPoolExecutor
-
await
public void await()
-
-
DMelt 3.0 © DataMelt by jWork.ORG