| java.lang.Object org.netbeans.lib.collab.util.Worker
Constructor Summary | |
public | Worker() | public | Worker(int threadCnt) | public | Worker(int minThreads, int maxThreads) | public | Worker(int minThreads, int maxThreads, int capacity) creates a Thread Pool
Parameters: minThreads - initial number of threads Parameters: maxThreads - maximum number of threads Parameters: capacity - maximum number of pending jobs in thequeue. | public | Worker(int minThreads, int maxThreads, int capacity, String thrNamePrefix) creates a Thread Pool
Parameters: minThreads - initial number of threads Parameters: maxThreads - maximum number of threads Parameters: capacity - maximum number of pending jobs in thequeue. | public | Worker(int minThreads, int maxThreads, String thrNamePrefix) creates a Thread Pool
Parameters: minThreads - initial number of threads Parameters: maxThreads - maximum number of threads Parameters: thrNamePrefix - prefix for pool thread names. |
Worker | public Worker(int threadCnt)(Code) | | creates a Thread Pool
Parameters: threadCnt - number of threads in this pool |
Worker | public Worker(int minThreads, int maxThreads)(Code) | | creates a Thread Pool
Parameters: minThreads - initial number of threads Parameters: maxThreads - maximum number of threadsIn this implementation the number of threads in the poolnever goes downn. |
Worker | public Worker(int minThreads, int maxThreads, int capacity)(Code) | | creates a Thread Pool
Parameters: minThreads - initial number of threads Parameters: maxThreads - maximum number of threads Parameters: capacity - maximum number of pending jobs in thequeue. if the queue size reaches this value, addRunnable blocks until the queue goes back below capacity. |
Worker | public Worker(int minThreads, int maxThreads, int capacity, String thrNamePrefix)(Code) | | creates a Thread Pool
Parameters: minThreads - initial number of threads Parameters: maxThreads - maximum number of threads Parameters: capacity - maximum number of pending jobs in thequeue. if the queue size reaches this value, addRunnable blocks until the queue goes back below capacity. Parameters: thrNamePrefix - prefix for pool thread names. This is usefulfor diagnostic if you have multiple Worker pools. |
Worker | public Worker(int minThreads, int maxThreads, String thrNamePrefix)(Code) | | creates a Thread Pool
Parameters: minThreads - initial number of threads Parameters: maxThreads - maximum number of threads Parameters: thrNamePrefix - prefix for pool thread names. This is usefulfor diagnostic if you have multiple Worker pools. |
addRunnable | public synchronized int addRunnable(Runnable r)(Code) | | Parameters: r - runnable to run number of elements in the job queue, including theone added by this method |
addRunnableIfPossible | public synchronized int addRunnableIfPossible(Runnable r)(Code) | | Parameters: r - runnable to run number of elements in the job queue, including theone added by this method |
backlog | public synchronized int backlog()(Code) | | |
isFull | public synchronized boolean isFull()(Code) | | |
stop | final public void stop()(Code) | | Stops and joins all threads of this worker
|
stop | final public void stop(Runnable r)(Code) | | Stop the worker thread with this last runnable object
Parameters: runnable - last job that will be run. After this runnableis dequeued, no other job is dequeued or enqueued. |
|
|