title: How do I use a runnable to do work in a Singleton?
body: <p>I have a question about using a runnable to do work in a singleton.</p>
  
  <p>I have an EventCoordinator class that is a singleton because it is the one that handles all events (and because my assignment requires me to do so).
  Events get added to this coordinator and will be processes later. 
  The events have to be processed in a different thread in which run takes events of the queue and processes them. the start method should start a new thread that takes events of the queue using run.</p>
  
  <pre class="lang-java prettyprint-override"><code>final public class EventCoordinator implements Runnable {
  
      protected final static EventCoordinator coordinator = new EventCoordinator();
      protected static LinkedList&lt;QueueItem&gt; queue = new LinkedList&lt;QueueItem&gt;();    
      private EventBroker() {
      }
  
      private class QueueItem {
          protected Event event;
  
  
          public QueueItem(Event event) {
              this.event = event;
          }
      }
  
      public static EventCoordinator getEventCoordinator () {
          return coordinator;
      }
  
      public void addEventObserver(EventObserver o) {
          //adds listeners to the coordinator
      }
  
  
  
      void addEvent(EventPublisher source, Event e) {
              QueueItem queueItem = new QueueItem(e, source);
              synchronized(this) { queue.add(queueItem); }
      }
  
  
      public void run() {
          // Process items from the queue
      }
  
      public void start() {
          // start a new thread that processes items of the queue
      }
  
  }
  </code></pre>
  
  <p>But the way I understand runnables is that when you create a <code>thread = new Thread(New EventCoordinator)</code> you create a new EventCoordinator object and thus are not working on the same queue anymore.
  So how can you use a runnable to do this work of the queue? Do I make the queue static? Do I implement methodes to add and remove items from the queue and do I invoke them on the coordinator returned by getEventCoordinator?</p>