@Override public Method getMethod() { return method.getMethod(); }
protected BuiltResponse invokeOnTarget(HttpRequest request, HttpResponse response, Object target) { final RESTEasyTracingLogger tracingLogger = RESTEasyTracingLogger.getInstance(request); final long timestamp = tracingLogger.timestamp("METHOD_INVOKE"); try { ResteasyContext.pushContext(ResourceInfo.class, resourceInfo); // we don't pop so writer interceptors can get at this PostMatchContainerRequestContext requestContext = new PostMatchContainerRequestContext(request, this, requestFilters, () -> invokeOnTargetAfterFilter(request, response, target)); // let it handle the continuation return requestContext.filter(); } finally { if (resource instanceof SingletonResource) { tracingLogger.logDuration("METHOD_INVOKE", timestamp, ((SingletonResource) resource).traceInfo(), method.getMethod()); } else { tracingLogger.logDuration("METHOD_INVOKE", timestamp, resource, method.getMethod()); } } }
@Override public void removeRegistrations(ResourceClass resourceClass) { for (ResourceMethod method : resourceClass.getResourceMethods()) { if (widerMatching) rootNode.removeBinding(method.getFullpath(), method.getMethod()); else root.removeBinding(resourceClass.getPath(), method.getFullpath(), method.getMethod()); } for (ResourceLocator method : resourceClass.getResourceLocators()) { if (widerMatching) rootNode.removeBinding(method.getFullpath(), method.getMethod()); else root.removeBinding(resourceClass.getPath(), method.getFullpath(), method.getMethod()); } }
@Override public Method getMethod() { return method.getMethod(); }
@Override public Method getMethod() { return method.getMethod(); }
System.out.println(new Date() + " Method : " + method.getMethod().getName() + " being called from " + req.getRemoteHost()+":"+req.getLocalPort()+": Remote Port "+req.getRemotePort()); if ( "defaultMethod".equalsIgnoreCase(method.getMethod().getName())) { return null; // normal flow continues } else { System.out.println(new Date() + " Method : " + method.getMethod().getName() + " Precondition failed "); return (ServerResponse) Response .status(Response.Status.PRECONDITION_FAILED).entity("invalid method details provided !!").build();
WebApplicationException { Securable securable = resourceMethod.getMethod().getAnnotation(Securable.class); String headerValue = servletRequest.getHeader(securable.header());
public ResourceClassBuilder buildMethod() { ResteasyUriBuilder builder = new ResteasyUriBuilder(); if (method.resourceClass.path != null) builder.path(method.resourceClass.path); if (method.path != null) builder.path(method.path); String pathExpression = builder.getPath(); if (pathExpression == null) pathExpression = ""; method.fullpath = pathExpression; if (method.resourceClass.getClazz().isAnonymousClass()) { method.getMethod().setAccessible(true); } resourceClassBuilder.resourceMethods.add(method); return resourceClassBuilder; } }
jaxrsRes.contextPath = contextPath; jaxrsRes.httpMethods = resMethod.getHttpMethods(); jaxrsRes.method = resMethod.getMethod(); jaxrsRes.produceTypes = resMethod.getProduces(); jaxrsRes.resourceClass = resClass.getClazz(); jaxrsRes.resourcePath = resPath; jaxrsRes.servletMappings = servletMappings; addMethodParameters(jaxrsRes, resMethod.getMethod()); locatorRes.methodsDescriptions.add(jaxrsRes);
jaxrsRes.contextPath = contextPath; jaxrsRes.httpMethods = resMethod.getHttpMethods(); jaxrsRes.method = resMethod.getMethod(); jaxrsRes.produceTypes = resMethod.getProduces(); jaxrsRes.resourceClass = resClass.getClazz(); jaxrsRes.resourcePath = resPath; jaxrsRes.servletMappings = servletMappings; addMethodParameters(jaxrsRes, resMethod.getMethod()); locatorRes.methodsDescriptions.add(jaxrsRes);
public ResourceMethodBuilder produces(String... produces) { MediaType[] types = parseMediaTypes(produces); method.produces = types; for (MediaType mt : types) { if (!mt.getParameters().containsKey(MediaType.CHARSET_PARAMETER)) { if (MediaTypeHelper.isTextLike(mt)) { ResteasyDeployment deployment = ResteasyProviderFactory.getContextData(ResteasyDeployment.class); if (deployment != null && !deployment.isAddCharset()) { LogMessages.LOGGER.mediaTypeLacksCharset(mt, method.getMethod().getName()); } } } } return this; }
protected BuiltResponse invokeOnTarget(HttpRequest request, HttpResponse response, Object target) { final RESTEasyTracingLogger tracingLogger = RESTEasyTracingLogger.getInstance(request); final long timestamp = tracingLogger.timestamp("METHOD_INVOKE"); try { ResteasyContext.pushContext(ResourceInfo.class, resourceInfo); // we don't pop so writer interceptors can get at this PostMatchContainerRequestContext requestContext = new PostMatchContainerRequestContext(request, this, requestFilters, () -> invokeOnTargetAfterFilter(request, response, target)); // let it handle the continuation return requestContext.filter(); } finally { if (resource instanceof SingletonResource) { tracingLogger.logDuration("METHOD_INVOKE", timestamp, ((SingletonResource) resource).traceInfo(), method.getMethod()); } else { tracingLogger.logDuration("METHOD_INVOKE", timestamp, resource, method.getMethod()); } } }
@Override public void removeRegistrations(ResourceClass resourceClass) { for (ResourceMethod method : resourceClass.getResourceMethods()) { if (widerMatching) rootNode.removeBinding(method.getFullpath(), method.getMethod()); else root.removeBinding(resourceClass.getPath(), method.getFullpath(), method.getMethod()); } for (ResourceLocator method : resourceClass.getResourceLocators()) { if (widerMatching) rootNode.removeBinding(method.getFullpath(), method.getMethod()); else root.removeBinding(resourceClass.getPath(), method.getFullpath(), method.getMethod()); } }
@Override public void removeRegistrations(ResourceClass resourceClass) { for (ResourceMethod method : resourceClass.getResourceMethods()) { if (widerMatching) rootNode.removeBinding(method.getFullpath(), method.getMethod()); else root.removeBinding(resourceClass.getPath(), method.getFullpath(), method.getMethod()); } for (ResourceLocator method : resourceClass.getResourceLocators()) { if (widerMatching) rootNode.removeBinding(method.getFullpath(), method.getMethod()); else root.removeBinding(resourceClass.getPath(), method.getFullpath(), method.getMethod()); } }