@Override public Object run() { method.getDispatcher().dispatch(resource, context); return null; } });
@Override public void dispatch(final Object resource, final HttpContext context) { final AbstractResourceMethod resourceMethod = context.getUriInfo().getMatchedMethod(); final String key = getKey(resourceMethod); try { dispatcher.dispatch(resource, context); metrics.success(key); } catch (WebApplicationException e) { final int status = e.getResponse().getStatus(); if (status == 404) { metrics.success(key); } else if (status > 400 && status < 500) { metrics.badRequest(key); } else { metrics.failure(key); } throw e; } catch (Exception e) { metrics.failure(key); throw e; } }
method.getDispatcher().dispatch(resource, context);
requestDispatcher.dispatch( o, httpContext );
@Override public void dispatch(Object resource, HttpContext httpContext) { meter.mark(); underlying.dispatch(resource, httpContext); } }
@Override public void dispatch(Object resource, HttpContext httpContext) { final Timer.Context context = timer.time(); try { underlying.dispatch(resource, httpContext); } finally { context.stop(); } } }
@Override public void dispatch(Object resource, HttpContext context) { final Timer.Context time = timer.time(); try { wrappedDispatcher.dispatch(resource, context); } finally { time.stop(); } } }
@Override public void dispatch(Object resource, HttpContext httpContext) { try { underlying.dispatch(resource, httpContext); } catch (Exception e) { if (exceptionClass.isAssignableFrom(e.getClass()) || (e.getCause() != null && exceptionClass.isAssignableFrom(e.getCause().getClass()))) { meter.mark(); } InstrumentedResourceMethodDispatchProvider.<RuntimeException>throwUnchecked(e); } } }
@Override public Object run() { method.getDispatcher().dispatch(resource, context); return null; } });
@Override public void dispatch(Object resource, HttpContext httpContext) { meter.mark(); underlying.dispatch(resource, httpContext); } }
@Override public Object run() { method.getDispatcher().dispatch(resource, context); return null; } });
@Override public void dispatch(Object resource, HttpContext httpContext) { try { underlying.dispatch(resource, httpContext); } catch (Exception e) { if (exceptionClass.isAssignableFrom(e.getClass()) || (e.getCause() != null && exceptionClass.isAssignableFrom(e.getCause() .getClass()))) { meter.mark(); } InstrumentedResourceMethodDispatchProvider.<RuntimeException>rethrow(e); } } }
@Override public void dispatch(Object resource, HttpContext context) { dispatcher.dispatch(resource, context); context.getResponse().getHttpHeaders().add(HttpHeaders.CACHE_CONTROL, cacheControl); } }
@Override public void dispatch(Object resource, HttpContext httpContext) { if (context.getTenant() == null) { throw new WebApplicationException( ErrorUtil.buildError(Response.Status.NOT_FOUND, StandardError.NOT_A_VALID_TENANT, "No valid tenant at this address")); } underlying.dispatch(resource, httpContext); } }
@Override public void dispatch(Object resource, HttpContext httpContext) { final TimerContext context = timer.time(); try { underlying.dispatch(resource, httpContext); } finally { context.stop(); } } }
@Override public void dispatch(Object resource, HttpContext httpContext) { User user = context.getUser(); if (user != null) { if (!this.checkAuthorization(user)) { throw new WebApplicationException(Response.status(Response.Status.FORBIDDEN) .entity(new Error(Response.Status.FORBIDDEN, StandardError.INSUFFICIENT_PRIVILEGES, "Insufficient privileges")).type(MediaType.APPLICATION_JSON).build()); } } else { if (this.isTenantEmptyOfUser() && this.isCreateUserResource()) { // This means there is no user for that tenant yet, and this is the request to create the // initial user. // Awright, you good to go } else { // TODO make the authentication challenge configurable throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED) .header("WWW-Authenticate", "realm=\"Mayocat Shop\"") .entity("Request is not properly authenticated.") .type(MediaType.TEXT_PLAIN_TYPE) .build()); } } underlying.dispatch(resource, httpContext); }
@Override public void dispatch(final Object resource, final HttpContext context) { final AbstractResourceMethod resourceMethod = context.getUriInfo().getMatchedMethod(); final String key = getKey(resourceMethod); try { dispatcher.dispatch(resource, context); metrics.success(key); } catch (WebApplicationException e) { final int status = e.getResponse().getStatus(); if (status == 404) { metrics.success(key); } else if (status > 400 && status < 500) { metrics.badRequest(key); } else { metrics.failure(key); } throw e; } catch (Exception e) { metrics.failure(key); throw e; } }
method.getDispatcher().dispatch(resource, context);
method.getDispatcher().dispatch(resource, context);
requestDispatcher.dispatch( o, httpContext );