Пример #1
0
 public HandlerExecutionChain getHandler(HttpServletRequest request) throws Exception {
   ResteasyRequestWrapper requestWrapper =
       RequestUtil.getRequestWrapper(request, request.getMethod(), prefix);
   try {
     // NOTE: if invoker isn't found, RESTEasy throw NoReourceFoundFailure
     HttpRequest httpRequest = requestWrapper.getHttpRequest();
     if (!httpRequest.isInitial()) {
       String message =
           httpRequest.getUri().getPath()
               + " is not initial request.  Its suspended and retried.  Aborting.";
       logger.error(message);
       requestWrapper.setError(500, message);
     } else {
       Response response = dispatcher.preprocess(httpRequest);
       if (response != null) {
         requestWrapper.setAbortedResponse(response);
       } else {
         requestWrapper.setInvoker(getInvoker(httpRequest));
       }
     }
     return new HandlerExecutionChain(requestWrapper, interceptors);
   } catch (NotFoundException e) {
     if (throwNotFound) {
       throw e;
     }
     logger.error("Resource Not Found: " + e.getMessage(), e);
   } catch (Failure e) {
     logger.error("ResourceFailure: " + e.getMessage(), e);
     throw e;
   }
   return null;
 }