public synchronized long findResponseTimeThreshold(Resource resource) { if (!(resource instanceof EndPointAwareResource)) { throw new IllegalArgumentException("Only EndPoint resources have a defined threshold"); } EndPointAwareResource endpoint = (EndPointAwareResource) resource; NapdexTraceTagRule napdexRule = findResponseTimeRule(endpoint.getEndPointName()); return napdexRule.getThreshold(); }