public ProfileLocator getProfile(RequestContext context, ProfilingRule rule) throws ProfilerException { // create a profile locator for given rule return rule.apply(context, this); }
public ProfileLocator getDefaultProfile(RequestContext context, String locatorName) throws ProfilerException { // find a profiling rule for the default principal ProfilingRule rule = getRuleForPrincipal(DEFAULT_RULE_PRINCIPAL, locatorName); if (null == rule) { log.warn("Could not find profiling rule for principal: " + DEFAULT_RULE_PRINCIPAL); rule = this.getDefaultRule(); } if (null == rule) { String msg = "Couldn't find any profiling rules including default rule for principal " + DEFAULT_RULE_PRINCIPAL; log.error(msg); throw new ProfilerException(msg); } // create a profile locator for given rule return rule.apply(context, this); }
return rule.apply(context, this);