@Override public Resource getMatchedModelResource() { return matchedResourceMethod == null ? null : matchedResourceMethod.getParent(); }
@Override public Resource getMatchedModelResource() { return matchedResourceMethod == null ? null : matchedResourceMethod.getParent(); }
/** * Get the method unique string ID. The ID is constructed from method attributes separated * by pipe '|'. The attributes are used in the following order: * method-produces|method-consumes|http-method|method-path|method-java-name * <p> * If any of the attributes is not defined, "null" is used for such an attribute. * <p/> * * @param method Resource method. * @return String constructed from resource method parameters. */ public static String getMethodUniqueId(final ResourceMethod method) { final String path = method.getParent() != null ? createPath(method.getParent()) : "null"; return method.getProducedTypes().toString() + "|" + method.getConsumedTypes().toString() + "|" + method.getHttpMethod() + "|" + path + "|" + method.getInvocable().getHandlingMethod().getName(); }
/** * Get the method unique string ID. The ID is constructed from method attributes separated * by pipe '|'. The attributes are used in the following order: * method-produces|method-consumes|http-method|method-path|method-java-name * <p> * If any of the attributes is not defined, "null" is used for such an attribute. * <p/> * * @param method Resource method. * @return String constructed from resource method parameters. */ public static String getMethodUniqueId(final ResourceMethod method) { final String path = method.getParent() != null ? createPath(method.getParent()) : "null"; return method.getProducedTypes().toString() + "|" + method.getConsumedTypes().toString() + "|" + method.getHttpMethod() + "|" + path + "|" + method.getInvocable().getHandlingMethod().getName(); }
/** * Add execution of a resource method. * * @param uri String uri which was executed. * @param resourceMethod Resource method. * @param methodTime Time spent on execution of resource method itself (Unix timestamp format). * @param methodDuration Time of execution of the resource method. * @param requestTime Time of whole request processing (from receiving the request until writing the response). (Unix * timestamp format) * @param requestDuration Time when the request matching to the executed resource method has been received by Jersey. */ void addExecution(final String uri, final ResourceMethod resourceMethod, final long methodTime, final long methodDuration, final long requestTime, final long requestDuration) { // Uri resource stats. ResourceStatisticsImpl.Builder uriStatsBuilder = uriStatistics.get(uri); if (uriStatsBuilder == null) { uriStatsBuilder = new ResourceStatisticsImpl.Builder(resourceMethod.getParent(), methodFactory); uriStatistics.put(uri, uriStatsBuilder); } uriStatsBuilder.addExecution(resourceMethod, methodTime, methodDuration, requestTime, requestDuration); // Class resource stats. final ResourceStatisticsImpl.Builder classStatsBuilder = getOrCreateResourceBuilder(resourceMethod); classStatsBuilder.addExecution(resourceMethod, methodTime, methodDuration, requestTime, requestDuration); // Resource method stats. methodFactory.getOrCreate(resourceMethod) .addResourceMethodExecution(methodTime, methodDuration, requestTime, requestDuration); }
/** * Add execution of a resource method. * * @param uri String uri which was executed. * @param resourceMethod Resource method. * @param methodTime Time spent on execution of resource method itself (Unix timestamp format). * @param methodDuration Time of execution of the resource method. * @param requestTime Time of whole request processing (from receiving the request until writing the response). (Unix * timestamp format) * @param requestDuration Time when the request matching to the executed resource method has been received by Jersey. */ void addExecution(final String uri, final ResourceMethod resourceMethod, final long methodTime, final long methodDuration, final long requestTime, final long requestDuration) { // Uri resource stats. ResourceStatisticsImpl.Builder uriStatsBuilder = uriStatistics.get(uri); if (uriStatsBuilder == null) { uriStatsBuilder = new ResourceStatisticsImpl.Builder(resourceMethod.getParent(), methodFactory); uriStatistics.put(uri, uriStatsBuilder); } uriStatsBuilder.addExecution(resourceMethod, methodTime, methodDuration, requestTime, requestDuration); // Class resource stats. final ResourceStatisticsImpl.Builder classStatsBuilder = getOrCreateResourceBuilder(resourceMethod); classStatsBuilder.addExecution(resourceMethod, methodTime, methodDuration, requestTime, requestDuration); // Resource method stats. methodFactory.getOrCreate(resourceMethod) .addResourceMethodExecution(methodTime, methodDuration, requestTime, requestDuration); }
@Override public Resource getMatchedModelResource() { return matchedResourceMethod == null ? null : matchedResourceMethod.getParent(); }
@Override public void visitResourceMethod(final ResourceMethod resourceMethod) { if (resourceMethod.isExtended()) { return; } if (ResourceMethod.JaxrsType.SUB_RESOURCE_LOCATOR.equals(resourceMethod.getType())) { if (resourceMethod.getInvocable() != null) { final Invocable i = resourceMethod.getInvocable(); final Type type = i.getResponseType(); final StringBuilder template = getTemplate(); mappings.put((Class) type, getMapping(template)); // Process sub resources ? Resource.Builder builder = Resource .builder(i.getRawResponseType()); if (builder == null) { // for example in the case the return type of the sub resource locator is Object builder = Resource.builder().path(resourceMethod.getParent().getPath()); } final Resource subResource = builder.build(); visitChildResource(subResource); } } processComponents(resourceMethod); }
/** * Get the method unique string ID. The ID is constructed from method attributes separated * by pipe '|'. The attributes are used in the following order: * method-produces|method-consumes|http-method|method-path|method-java-name * <p> * If any of the attributes is not defined, "null" is used for such an attribute. * <p/> * * @param method Resource method. * @return String constructed from resource method parameters. */ public static String getMethodUniqueId(final ResourceMethod method) { final String path = method.getParent() != null ? createPath(method.getParent()) : "null"; return method.getProducedTypes().toString() + "|" + method.getConsumedTypes().toString() + "|" + method.getHttpMethod() + "|" + path + "|" + method.getInvocable().getHandlingMethod().getName(); }
/** * Add execution of a resource method. * * @param uri String uri which was executed. * @param resourceMethod Resource method. * @param methodTime Time spent on execution of resource method itself (Unix timestamp format). * @param methodDuration Time of execution of the resource method. * @param requestTime Time of whole request processing (from receiving the request until writing the response). (Unix * timestamp format) * @param requestDuration Time when the request matching to the executed resource method has been received by Jersey. */ void addExecution(final String uri, final ResourceMethod resourceMethod, final long methodTime, final long methodDuration, final long requestTime, final long requestDuration) { // Uri resource stats. ResourceStatisticsImpl.Builder uriStatsBuilder = uriStatistics.get(uri); if (uriStatsBuilder == null) { uriStatsBuilder = new ResourceStatisticsImpl.Builder(resourceMethod.getParent(), methodFactory); uriStatistics.put(uri, uriStatsBuilder); } uriStatsBuilder.addExecution(resourceMethod, methodTime, methodDuration, requestTime, requestDuration); // Class resource stats. final ResourceStatisticsImpl.Builder classStatsBuilder = getOrCreateResourceBuilder(resourceMethod); classStatsBuilder.addExecution(resourceMethod, methodTime, methodDuration, requestTime, requestDuration); // Resource method stats. methodFactory.getOrCreate(resourceMethod) .addResourceMethodExecution(methodTime, methodDuration, requestTime, requestDuration); }
@Override public Resource getMatchedModelResource() { return matchedResourceMethod == null ? null : matchedResourceMethod.getParent(); }
@Override public Resource getMatchedModelResource() { return matchedResourceMethod == null ? null : matchedResourceMethod.getParent(); }
@Override public Resource getMatchedModelResource() { return matchedResourceMethod == null ? null : matchedResourceMethod.getParent(); }
@Override public Resource getMatchedModelResource() { return matchedResourceMethod == null ? null : matchedResourceMethod.getParent(); }
/** * Get the method unique string ID. The ID is constructed from method attributes separated * by pipe '|'. The attributes are used in the following order: * method-produces|method-consumes|http-method|method-path|method-java-name * <p> * If any of the attributes is not defined, "null" is used for such an attribute. * <p/> * * @param method Resource method. * @return String constructed from resource method parameters. */ public static String getMethodUniqueId(final ResourceMethod method) { final String path = method.getParent() != null ? createPath(method.getParent()) : "null"; return method.getProducedTypes().toString() + "|" + method.getConsumedTypes().toString() + "|" + method.getHttpMethod() + "|" + path + "|" + method.getInvocable().getHandlingMethod().getName(); }
/** * Get the method unique string ID. The ID is constructed from method attributes separated * by pipe '|'. The attributes are used in the following order: * method-produces|method-consumes|http-method|method-path|method-java-name * <p> * If any of the attributes is not defined, "null" is used for such an attribute. * <p/> * * @param method Resource method. * @return String constructed from resource method parameters. */ public static String getMethodUniqueId(final ResourceMethod method) { final String path = method.getParent() != null ? createPath(method.getParent()) : "null"; return method.getProducedTypes().toString() + "|" + method.getConsumedTypes().toString() + "|" + method.getHttpMethod() + "|" + path + "|" + method.getInvocable().getHandlingMethod().getName(); }