// Thread to monitor the queue of incoming NMCommunicator events
private class TezSubTaskRunner implements Runnable {
@Override
public void run() {
while (!Thread.currentThread().isInterrupted() && !serviceStopped.get()) {
NMCommunicatorEvent event;
try {
event = eventQueue.take();
switch (event.getType()) {
case CONTAINER_LAUNCH_REQUEST:
launch((NMCommunicatorLaunchRequestEvent) event);
break;
case CONTAINER_STOP_REQUEST:
stop((NMCommunicatorStopRequestEvent)event);