Guest User

Untitled

a guest
May 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. public void process(HttpServletRequest request, HttpServletResponse response)
  2. throws ServletException, IOException {
  3. final RackApplicationFactory rackFactory = context.getRackFactory();
  4. RackApplication app = null;
  5. try {
  6. app = rackFactory.getApplication();
  7. RackEnvironment env = new ServletRackEnvironment(request);
  8. RackResponse rack_resp = app.call(env);
  9. Object obj = env.getAttribute("async");
  10. if (obj == null) {
  11. rack_resp.respond(new ServletRackResponseEnvironment(response));
  12. } else {
  13. //JavaEmbedUtils.rubyToJava(app, );
  14. // mark the request asynchronous and properly clean up.
  15. if (request.isAsyncSupported() == true){
  16. AsyncContext ctx = request.startAsync();
  17. }
  18. }
  19. } catch (Exception re) {
  20. handleException(re, rackFactory, request, response);
  21. } finally {
  22. if (app != null) {
  23. rackFactory.finishedWithApplication(app);
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment