コード例 #1
0
 @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());
   }
 }
コード例 #2
0
 @Override
 public final void setPreferredCacheTTL(int ttl) {
   if (descriptor.isCacheable() && ttl > 0) {
     this.preferredCacheTTL.set(ttl);
   }
 }
コード例 #3
0
 @Override
 public final int getPreferredCacheTTL() {
   return descriptor.getPreferredCacheTTL();
 }