@Override public void setAttribute(String name, Object value) { delegate.setAttribute(name, value); }
@Override public void setProperty(String name, Object object) { httpRequest.setAttribute(name, object); }
@Override public void setProperty(String name, Object object) { if (object == null) { request.removeAttribute(name); } else { request.setAttribute(name, object); } }
@Override public void setProperty(String name, Object object) { if (object == null) { request.removeAttribute(name); } else { request.setAttribute(name, object); } }
protected SimpleViolationsContainer getViolationsContainer(HttpRequest request, Object target) { if (request == null) { return new SimpleViolationsContainer(target); } SimpleViolationsContainer violationsContainer = SimpleViolationsContainer.class.cast(request.getAttribute(SimpleViolationsContainer.class.getName())); if (violationsContainer == null) { violationsContainer = new SimpleViolationsContainer(target); request.setAttribute(SimpleViolationsContainer.class.getName(), violationsContainer); } return violationsContainer; }
protected Validator getValidator(HttpRequest request) { Validator v = Validator.class.cast(request.getAttribute(Validator.class.getName())); if (v == null) { Locale locale = getLocale(request); if (locale == null) { v = validatorFactory.getValidator(); } else { MessageInterpolator interpolator = new LocaleSpecificMessageInterpolator(validatorFactory.getMessageInterpolator(), locale); v = validatorFactory.usingContext().messageInterpolator(interpolator).getValidator(); } request.setAttribute(Validator.class.getName(), v); } return v; }
public CompletionStage<BuiltResponse> invoke(HttpRequest request, HttpResponse response, Object target) { request.setAttribute(ResourceMethodInvoker.class.getName(), this); incrementMethodCount(request.getHttpMethod()); ResteasyUriInfo uriInfo = (ResteasyUriInfo) request.getUri(); if (method.getPath() != null) { uriInfo.pushMatchedURI(uriInfo.getMatchingPath()); } uriInfo.pushCurrentResource(target); BuiltResponse rtn = invokeOnTarget(request, response, target); // FIXME: async return CompletableFuture.completedFuture(rtn); }
public CompletionStage<Object> invokeDryRun(HttpRequest request, HttpResponse response, Object target) { request.setAttribute(ResourceMethodInvoker.class.getName(), this); incrementMethodCount(request.getHttpMethod()); ResteasyUriInfo uriInfo = (ResteasyUriInfo) request.getUri(); if (method.getPath() != null) { uriInfo.pushMatchedURI(uriInfo.getMatchingPath()); } uriInfo.pushCurrentResource(target); return invokeOnTargetDryRun(request, response, target); }
request.setAttribute(RESTEASY_CHOSEN_ACCEPT, sortEntry.getAcceptType()); return sortEntry.match;
@Override public void setAttribute(String name, Object value) { delegate.setAttribute(name, value); }
import org.jboss.resteasy.plugins.providers.multipart.InputPart; @Provider @ServerInterceptor public class ContentTypeSetterPreProcessorInterceptor implements PreProcessInterceptor { public ServerResponse preProcess(HttpRequest request, ResourceMethod method) throws Failure, WebApplicationException { request.setAttribute(InputPart.DEFAULT_CONTENT_TYPE_PROPERTY, "*/*; charset=UTF-8"); return null; } }
@Provider @ServerInterceptor public class CharsetPreProcessInterceptor implements PreProcessInterceptor { @Override public ServerResponse preProcess(HttpRequest request, ResourceMethod method) throws Failure, WebApplicationException { request.setAttribute(InputPart.DEFAULT_CHARSET_PROPERTY, "charset=UTF-8"); return null; } }
@Override public void setAttribute(String name, Object value) { delegate.setAttribute(name, value); }
@Override public void setProperty(String name, Object object) { httpRequest.setAttribute(name, object); }
/** * According to configuration/request header it initialize {@link RESTEasyTracingLogger} and put it to the request properties. * * @param configuration application-wide tracing configuration type and tracing level threshold. * @param request request instance to get runtime properties to store {@link RESTEasyTracingLogger} instance to * if tracing support is enabled for the request. */ static void initTracingSupport(Configuration configuration, HttpRequest request) { if (!TRACING.AVAILABLE || request.getAttribute(RESTEasyTracing.PROPERTY_NAME) != null) return; final RESTEasyTracingLogger tracingLogger; if (RESTEasyTracingUtils.isTracingSupportEnabled(RESTEasyTracingUtils.getRESTEasyTracingConfig(configuration), request)) { tracingLogger = RESTEasyTracingLogger.create( RESTEasyTracingUtils.getTracingThreshold(RESTEasyTracingUtils.getRESTEasyTracingThreshold(configuration), request), RESTEasyTracingUtils.getTracingLoggerNameSuffix(request), RESTEasyTracingUtils.getTracingInfoFormat(request)); } else { tracingLogger = RESTEasyTracingLogger.empty(); } request.setAttribute(RESTEasyTracing.PROPERTY_NAME, tracingLogger); }
request.setAttribute(GeneralValidator.class.getName(), validator);
@Override public void setProperty(String name, Object object) { if (object == null) { request.removeAttribute(name); } else { request.setAttribute(name, object); } }
@Override public void setProperty(String name, Object object) { if (object == null) { request.removeAttribute(name); } else { request.setAttribute(name, object); } }
@Override public void setProperty(String name, Object object) { if (object == null) { request.removeAttribute(name); } else { request.setAttribute(name, object); } }
public CompletionStage<Object> invokeDryRun(HttpRequest request, HttpResponse response, Object target) { request.setAttribute(ResourceMethodInvoker.class.getName(), this); incrementMethodCount(request.getHttpMethod()); ResteasyUriInfo uriInfo = (ResteasyUriInfo) request.getUri(); if (method.getPath() != null) { uriInfo.pushMatchedURI(uriInfo.getMatchingPath()); } uriInfo.pushCurrentResource(target); return invokeOnTargetDryRun(request, response, target); }