T - Objetc type stored in Queue.public class DispatcherQueue<T> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
DispatcherQueue.Dispatcher<T> |
| Constructor and Description |
|---|
DispatcherQueue() |
DispatcherQueue(DispatcherQueue.Dispatcher<T> dispatcher) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all messages on the queue
|
protected Runnable |
createWorker(T t)
Create a Runnable to dispatch incomming messages
|
protected void |
dispatch(T t)
Dispatch objects in Queue
|
DispatcherQueue.Dispatcher<T> |
getDispatcher() |
Executor |
getExecutor() |
BlockingQueue<T> |
getQueue() |
void |
init()
Create and start dispatcher thread
|
boolean |
isRunning() |
void |
put(T t)
Insert a Object to the queue, waiting if necessary.
|
void |
setDispatcher(DispatcherQueue.Dispatcher<T> dispatcher) |
void |
setExecutor(Executor executor) |
void |
setQueue(BlockingQueue<T> queue) |
void |
setRunning(boolean running) |
int |
size()
Gets the number of messages on the queue.
|
void |
start() |
void |
stop()
Stop Dispatcher
|
public DispatcherQueue()
public DispatcherQueue(DispatcherQueue.Dispatcher<T> dispatcher)
public void init()
protected Runnable createWorker(T t)
msg - message to be dispatchedprotected void dispatch(T t)
msg - public int size()
Collection.size()public void put(T t)
t - object to put on queueBlockingQueue.put(java.lang.Object)public void clear()
Collection.clear()public void stop()
public void start()
public DispatcherQueue.Dispatcher<T> getDispatcher()
public void setDispatcher(DispatcherQueue.Dispatcher<T> dispatcher)
dispatcher - the dispatcher to setpublic BlockingQueue<T> getQueue()
public void setQueue(BlockingQueue<T> queue)
queue - the queue to setpublic boolean isRunning()
public void setRunning(boolean running)
running - the running to setpublic Executor getExecutor()
public void setExecutor(Executor executor)
executor - the executor to setCopyright © 2014 JDAL. All Rights Reserved.