@Override public final AttributeSet resolve(ResolverContext context) throws Exception { checkArgument(context.getDescriptor().getId().equals(descriptor.getId())); if (log.isDebugEnabled()) { log.debug( "Retrieving attributes via resolver id=\"{}\" name=\"{}\"", descriptor.getId(), descriptor.getName()); } Timer.Context timerCtx = timer.time(); try { return AttributeSet.builder(descriptor) .attributes(doResolve(context)) .ticker(context.getTicker()) .build(); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug(e.getMessage(), e); } throw e; } finally { histogram.update(timerCtx.stop()); } }
@Override public final void setPreferredCacheTTL(int ttl) { if (descriptor.isCacheable() && ttl > 0) { this.preferredCacheTTL.set(ttl); } }
@Override public final int getPreferredCacheTTL() { return descriptor.getPreferredCacheTTL(); }