Code example for SynchronousQueue

0
 */ 
public class ExceptionUtilities { 
	private static final Logger log = Logger.getLogger(ExceptionUtilities.class); 
	private static boolean exceptionDisplayActive = false;
	private static Queue<ExceptionSaver> exceptionQueue =
					new SynchronousQueue<ExceptionSaver>();
 
	private static class ExceptionSaver { 
		private ExceptionSaver(Exception exception, String msg) {
			this.exception = exception;
			this.msg = msg;
		} 
 
		public Exception exception;
		public String msg;
	} 
 
	/** 
	 * Displays an exception to the user. 
	 * Function is Thread-Safe. 
	 *