public void run() { try { while (!Thread.interrupted()) { Event event = q.take(); print(event); event.run(); } } catch (InterruptedException e) { // Acceptable way to exit } print("Finished Controller"); }
public void addEvent(Event c) { c.start(); q.put(c); }