public void shutdown() { Iterator i = servers.iterator(); while (i.hasNext()) { Server server = (Server) i.next(); server.shutdown(); } }
public void service(Request request) throws Exception { String path = request.getURI().getPath(); ListIterator i = new ArrayList(matchers).listIterator(); while (i.hasNext()) { int index = i.nextIndex(); Pattern pattern = (Pattern) i.next(); if (pattern.matcher(path).find()) { Server server = (Server) servers.get(index); server.service(request); return; } } request.respondWith(new NotFoundHandler("Could not find resource at " + path)); }
public void shutdown() { server.shutdown(); }
public void service(HttpServletRequest request, HttpServletResponse response) throws Exception { ThreadBlockingRequestResponse requestResponse = new ThreadBlockingRequestResponse(request, response); server.service(requestResponse); requestResponse.blockUntilRespond(); }