/** * Executes a request asynchronously. */ public static void executeAsync(AsyncCmisServlet servlet, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { AsyncCmisExecutor executor = getAsyncCmisExecutor(servlet.getServletConfig(), request, response); if (executor == null) { // there is no executor -> execute synchronously servlet.executeSync(request, response); } else { // there is an executor -> start asynchronous execution AsyncContext asyncContext = request.startAsync(); try { executor.execute(asyncContext, new CmisRequestRunner(asyncContext, servlet)); } catch (RejectedExecutionException ree) { if (LOG.isWarnEnabled()) { LOG.warn("Submitting async request failed: {}", ree.toString(), ree); } servlet.sendError(new CmisServiceUnavailableException("CMIS server is busy", ree), request, response); asyncContext.complete(); } catch (Exception e) { LOG.error("Executing async request failed: {}", e.toString(), e); servlet.sendError(e, request, response); asyncContext.complete(); } } }
return new CmisVersioningException(message, errorContent, additionalData, t); } else if (code == 503) { return new CmisServiceUnavailableException(message, errorContent, additionalData, t); return new CmisTooManyRequestsException(message, errorContent, t); case 503: return new CmisServiceUnavailableException(message, errorContent, t); default: return new CmisRuntimeException(message, errorContent, t);
return new CmisVersioningException(message, errorContent, additionalData, t); } else if (code == 503) { return new CmisServiceUnavailableException(message, errorContent, additionalData, t); return new CmisTooManyRequestsException(message, errorContent, t); case 503: return new CmisServiceUnavailableException(message, errorContent, t); default: return new CmisRuntimeException(message, errorContent, t);
return new CmisTooManyRequestsException(message, errorContent, additionalData, t); case 503: return new CmisServiceUnavailableException(message, errorContent, additionalData, t); default: if (CmisStorageException.EXCEPTION_NAME.equals(exception)) {