code: private void runAndWait() throws Exception {
  		// Start server thread
  		server.start();
  		Logger logger = LoggerFactory.getLogger(SimonJolokiaDemo.class);
  		logger.info("Jolokia Agent started http://localhost:8778/jolokia/");
  		logger.info("Search http://localhost:8778/jolokia/search/org.javasimon:*");
  		logger.info("Manager http://localhost:8778/jolokia/read/org.javasimon:type=Manager");
  		logger.info("Stopwatch http://localhost:8778/jolokia/read/org.javasimon:name=A,type=Stopwatch");
  		logger.info("Counter http://localhost:8778/jolokia/read/org.javasimon:name=X,type=Counter");
  		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  
  		String line;
  		boolean stop = false;
  		while (!stop && (line = reader.readLine()) != null) {
  			stop = line.toLowerCase().contains("stop");
  		}
  	}
docs: Run Jetty and wait till it stops.