Exemplo n.º 1
0
 /**
  * Propagate NotFoundException. This is used for Filters
  *
  * @param request
  * @param response
  */
 public void invokePropagateNotFound(HttpRequest request, HttpResponse response)
     throws NotFoundException {
   try {
     pushContextObjects(request, response);
     try {
       Response aborted = preprocess(request);
       if (aborted != null) {
         try {
           writeJaxrsResponse(request, response, aborted);
         } catch (Exception e) {
           handleWriteResponseException(request, response, e);
           return;
         }
         return;
       }
     } catch (Exception e) {
       handleException(request, response, e);
       return;
     }
     ResourceInvoker invoker = null;
     try {
       invoker = getInvoker(request);
     } catch (Exception failure) {
       if (failure instanceof NotFoundException) {
         throw ((NotFoundException) failure);
       } else {
         handleException(request, response, failure);
         return;
       }
     }
     try {
       invoke(request, response, invoker);
     } catch (Failure e) {
       handleException(request, response, e);
       return;
     }
   } finally {
     clearContextData();
   }
 }
Exemplo n.º 2
0
 public void invoke(HttpRequest request, HttpResponse response) {
   try {
     pushContextObjects(request, response);
     Response aborted = preprocess(request);
     if (aborted != null) {
       try {
         writeJaxrsResponse(request, response, aborted);
       } catch (Exception e) {
         handleWriteResponseException(request, response, e);
         return;
       }
       return;
     }
     ResourceInvoker invoker = getInvoker(request);
     invoke(request, response, invoker);
   } catch (Failure e) {
     handleException(request, response, e);
     return;
   } finally {
     clearContextData();
   }
 }
Exemplo n.º 3
0
 /**
  * Called if method invoke was successful, but writing the Response after was not.
  *
  * @param request
  * @param response
  * @param e
  */
 public void handleWriteResponseException(
     HttpRequest request, HttpResponse response, Exception e) {
   handleException(request, response, e);
 }
Exemplo n.º 4
0
 /**
  * Called if method invoke was unsuccessful
  *
  * @param request
  * @param response
  * @param e
  */
 public void handleInvokerException(HttpRequest request, HttpResponse response, Exception e) {
   handleException(request, response, e);
 }