private void doTimeoutHandler() {
		// Ensure we properly close in a separate thread so that
		// we can leverage the main thread, which is required for macs
		Thread wait = new Thread("FrameworkWaiter") {
			public void run() {
				try {
					FrameworkEvent result = systemBundle
							.waitForStop(parms.timeout);
					trace("framework event " + result + " " + result.getType());
					Thread.sleep(1000);
					switch (result.getType()) {
					case FrameworkEvent.STOPPED:
						System.exit(LauncherConstants.OK);
						break;
					case FrameworkEvent.WAIT_TIMEDOUT:
						System.exit(LauncherConstants.TIMEDOUT);
						break;

					case FrameworkEvent.ERROR:
						System.exit(LauncherConstants.ERROR);
						break;

					case FrameworkEvent.WARNING:
						System.exit(LauncherConstants.WARNING);
						break;

					case FrameworkEvent.STOPPED_BOOTCLASSPATH_MODIFIED:
					case FrameworkEvent.STOPPED_UPDATE:
						System.exit(LauncherConstants.UPDATE_NEEDED);
						break;
					}
				} catch (InterruptedException e) {
					System.exit(LauncherConstants.CANCELED);
				} finally {
					System.err.println("System exiting due to timeout of "
							+ parms.timeout);
				}
			}
		};
		wait.start();
	}