public class DefaultEventLoop extends Object implements EventLoop<ArrayBlockingQueue<Command>,Thread>
Modifier and Type | Field and Description |
---|---|
private ArrayBlockingQueue<Command> |
eventQueue |
private Thread |
thread |
Constructor and Description |
---|
DefaultEventLoop(ArrayBlockingQueue<Command> eventQueue,
Thread thread) |
Modifier and Type | Method and Description |
---|---|
Thread |
getConsumer() |
ArrayBlockingQueue<Command> |
getQueue() |
void |
publish(Command command) |
void |
setConsumer(Thread consumer) |
void |
setQueue(ArrayBlockingQueue<Command> queue) |
void |
start() |
private final ArrayBlockingQueue<Command> eventQueue
private final Thread thread
public DefaultEventLoop(ArrayBlockingQueue<Command> eventQueue, Thread thread)
public void publish(Command command)
publish
in interface EventLoop<ArrayBlockingQueue<Command>,Thread>
public void start()
start
in interface EventLoop<ArrayBlockingQueue<Command>,Thread>
public ArrayBlockingQueue<Command> getQueue()
getQueue
in interface EventLoop<ArrayBlockingQueue<Command>,Thread>
public Thread getConsumer()
getConsumer
in interface EventLoop<ArrayBlockingQueue<Command>,Thread>
public void setQueue(ArrayBlockingQueue<Command> queue)
setQueue
in interface EventLoop<ArrayBlockingQueue<Command>,Thread>
public void setConsumer(Thread consumer)
setConsumer
in interface EventLoop<ArrayBlockingQueue<Command>,Thread>
Copyright © 2013. All Rights Reserved.