Created
September 21, 2013 11:47
-
-
Save ybonnel/6649841 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public AbstractHandler getHandler() { | |
return new AbstractHandler() { | |
@Override | |
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { | |
if (request.getPathInfo().equals(route + "/nextCommand")) { | |
String nextCommand; | |
synchronized (elevator) { | |
nextCommand = elevator.nextCommand(); | |
} | |
response.getWriter().print(nextCommand); | |
response.getWriter().flush(); | |
response.getWriter().close(); | |
} | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment