this.resourceInvoker = resourceInvoker; this.method = resourceInvoker.getMethod(); this.klass = resourceInvoker.getResourceClass(); Path methodPath = method.getAnnotation(Path.class); methodUri = methodPath == null ? null : methodPath.value();
this.klass = invoker.getResourceClass();
else if (httpMethod.equals("HEAD")) method = new HeadResourceMethod(); method.setClazz(rm.getResourceClass().getName()); method.setMethod(rm.getMethod().getName()); AtomicLong stat = rm.getStats().get(httpMethod);
private String formatMethod(ResourceMethodInvoker resource, String servletMapping, String path, String contextRootPath) { StringBuilder builder = new StringBuilder(); builder.append("%1$s "); String servletPath = servletMapping.replaceAll("\\*", ""); if(servletPath.charAt(0) == '/') { servletPath = servletPath.substring(1); } builder.append(contextRootPath).append('/').append(servletPath).append(path); builder.append(" - ").append(resource.getResourceClass().getCanonicalName()).append('.').append(resource.getMethod().getName()).append('('); if (resource.getMethod().getParameterTypes().length > 0) { builder.append("..."); } builder.append(')'); return builder.toString().replaceAll("//", "/"); }
private String formatMethod(ResourceMethodInvoker resource, String servletMapping, String path, String contextRootPath) { StringBuilder builder = new StringBuilder(); builder.append("%1$s "); String servletPath = servletMapping.replaceAll("\\*", ""); if(servletPath.charAt(0) == '/') { servletPath = servletPath.substring(1); } builder.append(contextRootPath).append('/').append(servletPath).append(path); builder.append(" - ").append(resource.getResourceClass().getCanonicalName()).append('.').append(resource.getMethod().getName()).append('('); if (resource.getMethod().getParameterTypes().length > 0) { builder.append("..."); } builder.append(')'); return builder.toString().replaceAll("//", "/"); }
public void filter(ContainerRequestContext requestContext) { UriRoutingContext routingContext = (UriRoutingContext) requestContext.getUriInfo(); ResourceMethodInvoker invoker = (ResourceMethodInvoker) routingContext.getInflector(); Class<?> className = invoker.getResourceClass(); Method methodName = invoker.getResourceMethod(); }
void handle(ModelNode response, String contextRootPath, Collection<String> servletMappings, String mapping, List<ResourceInvoker> resources) { for (ResourceInvoker resourceInvoker : resources) { if (ResourceMethodInvoker.class.isAssignableFrom(resourceInvoker.getClass())) { ResourceMethodInvoker resource = (ResourceMethodInvoker) resourceInvoker; final ModelNode node = new ModelNode(); node.get(CLASSNAME.getName()).set(resource.getResourceClass().getCanonicalName()); node.get(PATH.getName()).set(mapping); for (String servletMapping : servletMappings) { String method = formatMethod(resource, servletMapping, mapping, contextRootPath); for (final String httpMethod : resource.getHttpMethods()) { node.get(METHODS.getName()).add(String.format(method, httpMethod)); } } response.add(node); } } }
void handle(ModelNode response, String contextRootPath, Collection<String> servletMappings, String mapping, List<ResourceInvoker> resources) { for (ResourceInvoker resourceInvoker : resources) { if (ResourceMethodInvoker.class.isAssignableFrom(resourceInvoker.getClass())) { ResourceMethodInvoker resource = (ResourceMethodInvoker) resourceInvoker; final ModelNode node = new ModelNode(); node.get(CLASSNAME.getName()).set(resource.getResourceClass().getCanonicalName()); node.get(PATH.getName()).set(mapping); for (String servletMapping : servletMappings) { String method = formatMethod(resource, servletMapping, mapping, contextRootPath); for (final String httpMethod : resource.getHttpMethods()) { node.get(METHODS.getName()).add(String.format(method, httpMethod)); } } response.add(node); } } }
log.error(method.getResourceClass() + "." + method.getMethod().getName() + " did not set QUERY_ID threadlocal."); } else { id = QUERY_ID.get();
this.klass = invoker.getResourceClass();
private JaxrsResourceMethodDescription resMethodDescription(ResourceMethodInvoker methodInvoker, String contextPath, String mapping, Collection<String> servletMappings) { JaxrsResourceMethodDescription jaxrsRes = new JaxrsResourceMethodDescription(); jaxrsRes.consumeTypes = methodInvoker.getConsumes(); jaxrsRes.contextPath = contextPath; jaxrsRes.httpMethods = methodInvoker.getHttpMethods(); jaxrsRes.method = methodInvoker.getMethod(); jaxrsRes.produceTypes = methodInvoker.getProduces(); jaxrsRes.resourceClass = methodInvoker.getResourceClass(); jaxrsRes.resourcePath = mapping; jaxrsRes.servletMappings = servletMappings; addMethodParameters(jaxrsRes, methodInvoker.getMethod()); return jaxrsRes; }
private JaxrsResourceMethodDescription resMethodDescription(ResourceMethodInvoker methodInvoker, String contextPath, String mapping, Collection<String> servletMappings) { JaxrsResourceMethodDescription jaxrsRes = new JaxrsResourceMethodDescription(); jaxrsRes.consumeTypes = methodInvoker.getConsumes(); jaxrsRes.contextPath = contextPath; jaxrsRes.httpMethods = methodInvoker.getHttpMethods(); jaxrsRes.method = methodInvoker.getMethod(); jaxrsRes.produceTypes = methodInvoker.getProduces(); jaxrsRes.resourceClass = methodInvoker.getResourceClass(); jaxrsRes.resourcePath = mapping; jaxrsRes.servletMappings = servletMappings; addMethodParameters(jaxrsRes, methodInvoker.getMethod()); return jaxrsRes; }