code: @Override
  	public void run()
  	{
  		System.out.println("Event monitor starting...");
  
  		while(!shouldShutDown)
  		{
  			try
  			{
  				synchronized (eventQueue)
  				{
  					if (eventQueue.isEmpty())
  					{
  						eventQueue.wait(delay);		// Support wake-up via eventQueue.notify()
  					}
  				}
  			}
  			catch (InterruptedException e)
  			{
  				e.printStackTrace();
  				System.err.println("Interrupted (use shutdown() to terminate).  Continuing...");
  				continue;
  			}
  
  			Object event = null;
  
  			while ((event = eventQueue.poll()) != null)
  			{
  				processEvent(event);
  			}
  		}
  		
  		System.out.println("Event monitor exiting...");
  		clearAllHandlers();
  	}
docs: SECTION: RUNNABLE/THREAD