|
CubeTwister 2.0alpha142 2012-02-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.util.SimpleSequentialDispatcher
public class SimpleSequentialDispatcher
Processes Runnable objects sequentially on a processor thread. The order in which the runnable objects are processed is the same in which they were added to the dispatcher.
This is a simple implementation of a sequential dispatcher. This class is a standalone implementation for use by applications, which only need this kind of dispatcher. It has been cludged together from several classes out of the SoftBricks Library.
| Constructor Summary | |
|---|---|
SimpleSequentialDispatcher()
Creates a new instance which processes events at Thread.NORM_PRORITY. |
|
SimpleSequentialDispatcher(int priority)
Creates a new instance which processes events at the desired thread priority. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the event queue. |
protected void |
collectEvent(java.lang.Object event)
Collects an event and puts it into the event queue for later processing. |
void |
dispatch(java.lang.Runnable r)
Queues the Runnable object for later execution on the processor thread. |
protected void |
processEvent(java.lang.Object event)
This method processes a single event on the event processor thread. |
void |
start()
Starts the event processor. |
void |
stop()
Stops the event processor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleSequentialDispatcher()
public SimpleSequentialDispatcher(int priority)
priority - The Thread priority of the event processor.| Method Detail |
|---|
public void dispatch(java.lang.Runnable r)
protected void processEvent(java.lang.Object event)
event - An event from the queue.protected void collectEvent(java.lang.Object event)
event - The event to be put into the queue.public void start()
public void stop()
public void clear()
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||