Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.monte.media.concurrent
Class SequentialDispatcher

    java.lang.Object
      org.monte.media.concurrent.EventLoop
          org.monte.media.concurrent.SequentialDispatcher

    public class SequentialDispatcher

extends EventLoop

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.

Design pattern used: Acceptor Role in design pattern: EventCollector and EventProcessor

Version:
  1.0 2002-05-18 Created
Author:
  Werner Randelshofef

Field Summary

Fields inherited from class org.monte.media.concurrent.EventLoop
`eventProcessor`

Constructor Summary
`SequentialDispatcher()` Creates new SequentialDispatcher which processes Runnable objects at java.lang.Thread.NORM_PRIORITY.
`SequentialDispatcher(int priority)` Creates a new SequentialDispatcher which processes Runnable Objects at the desired thread priority.

Method Summary
`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 an event on the event processor thread.

Methods inherited from class org.monte.media.concurrent.EventLoop
`clear, collectEvent, isCoalesce, join, processEvents, setCoalesce, start, stop`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SequentialDispatcher

    public SequentialDispatcher()

  Creates new SequentialDispatcher which processes Runnable objects at java.lang.Thread.NORM_PRIORITY.

### SequentialDispatcher

    public SequentialDispatcher(int priority)

  Creates a new SequentialDispatcher which processes Runnable Objects at the desired thread priority.

  Parameters:
    `priority` - The Thread priority of the event processor.

Method Detail

### processEvent

    protected void processEvent(java.lang.Object event)

  This method processes an event on the event processor thread.

  Specified by:
    `processEvent` in class `EventLoop`
  Parameters:
    `event` - An event from the queue.

### dispatch

    public void dispatch(java.lang.Runnable r)

  Queues the Runnable object for later execution on the processor thread.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD