private Health getHealth(Principal principal) {
   long accessTime = System.currentTimeMillis();
   if (isCacheStale(accessTime)) {
     this.lastAccess = accessTime;
     this.cached = this.delegate.invoke();
   }
   if (exposeHealthDetails(principal)) {
     return this.cached;
   }
   return Health.status(this.cached.getStatus()).build();
 }
Exemplo n.º 2
0
 @Bean
 HealthIndicator healthIndicator() {
   return () -> Health.status("I <3 RWX & Ft. Lauderdale").build();
 }