| |
|
| java.lang.Object biz.hammurapi.dispatch.Dispatcher biz.hammurapi.dispatch.QueuingDispatcher
QueuingDispatcher | public class QueuingDispatcher extends Dispatcher (Code) | | This class puts results to a queue, which is processed by a worker.
An internal thread is used to push jobs to worker or execute jobs if worker is null.
author: Pavel Vlasov |
Inner Class :protected class DispatchJob implements Runnable | |
Constructor Summary | |
public | QueuingDispatcher(Collection targets, Worker worker) Constructor
Parameters: targets - Parameters: worker - Worker to delegate dispatching jobs to. |
Method Summary | |
public void | dispatch(Object arg) Puts argument to dispatching queue. | public void | join() Blocks until all jobs are processed. | protected void | postJobToQueue(Runnable foreignJob) Allows subclasses to post non-dispatching jobs to the queue. | public void | stop() Processes all jobs and stops queue processing thread. |
QueuingDispatcher | public QueuingDispatcher(Collection targets, Worker worker)(Code) | | Constructor
Parameters: targets - Parameters: worker - Worker to delegate dispatching jobs to. Can be null. |
dispatch | public void dispatch(Object arg)(Code) | | Puts argument to dispatching queue.
The queue is processed by an internal thread, which posts dispatching jobs to worker or
processes them itself if worker is null.
|
postJobToQueue | protected void postJobToQueue(Runnable foreignJob)(Code) | | Allows subclasses to post non-dispatching jobs to the queue.
Parameters: job - |
|
|
|