de.tub.citydb.api.concurrent
Class WorkerPool<T>

java.lang.Object
  extended by de.tub.citydb.api.concurrent.WorkerPool<T>
Direct Known Subclasses:
SingleWorkerPool

public class WorkerPool<T>
extends java.lang.Object


Nested Class Summary
static class WorkerPool.WorkQueue<E>
           
 
Constructor Summary
WorkerPool(int corePoolSize, int maximumPoolSize, WorkerFactory<T> workerFactory, int queueSize)
           
WorkerPool(int corePoolSize, int maximumPoolSize, WorkerFactory<T> workerFactory, int queueSize, boolean fair)
           
WorkerPool(int corePoolSize, int maximumPoolSize, WorkerFactory<T> workerFactory, int queueSize, boolean fair, boolean daemon)
           
 
Method Summary
 void addWork(T work)
           
 void addWorkAndWait(T work)
           
 void awaitQueueEmpty()
           
 java.util.List<T> drainWorkQueue()
           
 int getCorePoolSize()
           
 java.lang.ClassLoader getDefaultContextClassLoader()
           
 int getMaximumPoolSize()
           
 int getMaximumQueueSize()
           
 int getPoolSize()
           
 WorkerFactory<T> getWorkerFactory()
           
 WorkerPool.WorkQueue<T> getWorkQueue()
           
 boolean isTerminated()
           
 boolean isTerminating()
           
 void join()
           
 boolean prestartCoreWorker()
           
 int prestartCoreWorkers()
           
 void setContextClassLoader(java.lang.ClassLoader contextClassLoader)
           
 void setCorePoolSize(int corePoolSize)
           
 void setMaximumPoolSize(int maximumPoolSize)
           
 void shutdown()
           
 void shutdownAndWait()
           
 java.util.List<T> shutdownNow()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkerPool

public WorkerPool(int corePoolSize,
                  int maximumPoolSize,
                  WorkerFactory<T> workerFactory,
                  int queueSize,
                  boolean fair,
                  boolean daemon)

WorkerPool

public WorkerPool(int corePoolSize,
                  int maximumPoolSize,
                  WorkerFactory<T> workerFactory,
                  int queueSize,
                  boolean fair)

WorkerPool

public WorkerPool(int corePoolSize,
                  int maximumPoolSize,
                  WorkerFactory<T> workerFactory,
                  int queueSize)
Method Detail

getDefaultContextClassLoader

public java.lang.ClassLoader getDefaultContextClassLoader()

setContextClassLoader

public void setContextClassLoader(java.lang.ClassLoader contextClassLoader)

addWork

public void addWork(T work)

addWorkAndWait

public void addWorkAndWait(T work)

prestartCoreWorker

public boolean prestartCoreWorker()

prestartCoreWorkers

public int prestartCoreWorkers()

shutdown

public void shutdown()

shutdownAndWait

public void shutdownAndWait()
                     throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

shutdownNow

public java.util.List<T> shutdownNow()

join

public void join()
          throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

awaitQueueEmpty

public void awaitQueueEmpty()

drainWorkQueue

public java.util.List<T> drainWorkQueue()

getWorkQueue

public WorkerPool.WorkQueue<T> getWorkQueue()

getWorkerFactory

public WorkerFactory<T> getWorkerFactory()

getMaximumQueueSize

public int getMaximumQueueSize()

setMaximumPoolSize

public void setMaximumPoolSize(int maximumPoolSize)

getMaximumPoolSize

public int getMaximumPoolSize()

getCorePoolSize

public int getCorePoolSize()

setCorePoolSize

public void setCorePoolSize(int corePoolSize)

isTerminated

public boolean isTerminated()

isTerminating

public boolean isTerminating()

getPoolSize

public int getPoolSize()