|
Copyright 2011-09-18 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.util.FixedConcurrentDispatcher
public class FixedConcurrentDispatcher
A concurrentDispatcher with a fixed number of prealocated threads.
| Constructor Summary | |
|---|---|
FixedConcurrentDispatcher()
Creates a new FixedConcurrentDispatcher and sets the priority of the processor thread to java.lang.Thread.NORM_PRIORITY and with the available number of processors in the thread pool. |
|
FixedConcurrentDispatcher(int priority,
int threadCount)
Creates a new FixedConcurrentDispatcher. |
|
| Method Summary | |
|---|---|
void |
dispatch(java.lang.Runnable runner)
Enqueues the Runnable object, and executes it on a processor thread. |
void |
enqueue(java.lang.Runnable runner)
Enqueues the Runnable object but does not grant that it is being executed. |
void |
join()
Joins all workers of the dispatcher. |
protected void |
processEvents()
This method dequeues all Runnable objects from the queue and executes them. |
void |
start()
Starts all workers of the dispatcher. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FixedConcurrentDispatcher()
public FixedConcurrentDispatcher(int priority,
int threadCount)
priority - The priority of the processor
thread.threadCount - The maximal number of concurrent
threads in the thread pool.| Method Detail |
|---|
public void dispatch(java.lang.Runnable runner)
dispatch in interface Dispatcherprotected void processEvents()
public void join()
join in interface Dispatcherpublic void enqueue(java.lang.Runnable runner)
public void start()
|
Copyright 2011-09-18 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||