Java 类org.springframework.boot.actuate.health.HealthAggregator 实例源码

项目:extended-actuator-health-endpoints    文件:ExtendedHealthMvcEndpointUnitTest.java   
@Test
public void downWithExceptionHandling() throws Exception {

    HealthAggregator healthAggregator = mock(HealthAggregator.class);
    ApplicationAliveIndicator healthIndicator = mock(ApplicationAliveIndicator.class);
    when(healthIndicator.health()).thenThrow(new RuntimeException("fooException"));
    Map<String, ApplicationAliveIndicator> healthIndicators = new LinkedHashMap<>();
    healthIndicators.put("foo", healthIndicator);

    when(applicationContext.getBeansOfType(ApplicationAliveIndicator.class)).thenReturn(healthIndicators);


    extendedHealthEndpoint = new AliveHealthEndpoint("healthIndicatorfoo", healthAggregator);
    extendedHealthEndpoint.setApplicationContext(applicationContext);

    this.extendedHealthMvcEndpoint = new ExtendedHealthMvcEndpoint(this.extendedHealthEndpoint);

    ResponseEntity<Health> result = (ResponseEntity<Health>) this.extendedHealthMvcEndpoint.invoke(null);

    Map<String, Object> expectedHealthDetails = new LinkedHashMap<>();
    expectedHealthDetails.put("error", "java.lang.RuntimeException: fooException");
    assertThat(result.getBody().getDetails(), is(expectedHealthDetails));
    assertThat(result.getStatusCode(), is(HttpStatus.SERVICE_UNAVAILABLE));
    assertThat(result.getBody().getStatus(), is(Status.DOWN));
}
项目:generator-jhipster-grpc    文件:_HealthService.java   
public HealthService(HealthAggregator healthAggregator, Map<String, org.springframework.boot.actuate.health.HealthIndicator> healthIndicators) {
    Assert.notNull(healthAggregator, "HealthAggregator must not be null");
    Assert.notNull(healthIndicators, "HealthIndicators must not be null");
    CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(
        healthAggregator);
    for (Map.Entry<String, org.springframework.boot.actuate.health.HealthIndicator> entry : healthIndicators.entrySet()) {
        healthIndicator.addHealthIndicator(getKey(entry.getKey()), entry.getValue());
    }
    this.healthIndicators = healthIndicators;
    this.healthIndicator = healthIndicator;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointAutoConfiguration.java   
public EndpointAutoConfiguration(
        ObjectProvider<HealthAggregator> healthAggregatorProvider,
        ObjectProvider<Map<String, HealthIndicator>> healthIndicatorsProvider,
        ObjectProvider<List<InfoContributor>> infoContributorsProvider,
        ObjectProvider<Collection<PublicMetrics>> publicMetricsProvider,
        ObjectProvider<TraceRepository> traceRepositoryProvider) {
    this.healthAggregator = healthAggregatorProvider.getIfAvailable();
    this.healthIndicators = healthIndicatorsProvider.getIfAvailable();
    this.infoContributors = infoContributorsProvider.getIfAvailable();
    this.publicMetrics = publicMetricsProvider.getIfAvailable();
    this.traceRepository = traceRepositoryProvider.getIfAvailable();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthEndpoint.java   
/**
 * Create a new {@link HealthIndicator} instance.
 * @param healthAggregator the health aggregator
 * @param healthIndicators the health indicators
 */
public HealthEndpoint(HealthAggregator healthAggregator,
        Map<String, HealthIndicator> healthIndicators) {
    super("health", false);
    Assert.notNull(healthAggregator, "HealthAggregator must not be null");
    Assert.notNull(healthIndicators, "HealthIndicators must not be null");
    CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(
            healthAggregator);
    for (Map.Entry<String, HealthIndicator> entry : healthIndicators.entrySet()) {
        healthIndicator.addHealthIndicator(getKey(entry.getKey()), entry.getValue());
    }
    this.healthIndicator = healthIndicator;
}
项目:spring-boot-starter-prometheus    文件:PrometheusEndpoint.java   
public PrometheusEndpoint(Collection<PublicMetrics> publicMetrics,
        PrometeusMetricNameConverter prometeusMetricNameConverter, Map<String, HealthIndicator> healthIndicators,
        HealthAggregator healthAggregator) {
    super("prometheus", false, true);
    this.publicMetrics = publicMetrics;
    this.prometeusMetricNameConverter = prometeusMetricNameConverter;
    this.healthIndicators = healthIndicators;
    this.healthAggregator = healthAggregator;

}
项目:spring-boot-starter-prometheus    文件:PrometheusEndpointConfiguration.java   
@Bean
@ConditionalOnMissingBean
@Autowired
public PrometheusEndpoint prometheusEndpoint(Collection<PublicMetrics> publicMetrics,
        PrometeusMetricNameConverter prometeusMetricNameConverter, Map<String, HealthIndicator> healthIndicators,
        HealthAggregator healthAggregator) {

    return new PrometheusEndpoint(publicMetrics, prometeusMetricNameConverter, healthIndicators, healthAggregator);
}
项目:spring-boot-concourse    文件:EndpointAutoConfiguration.java   
public EndpointAutoConfiguration(
        ObjectProvider<HealthAggregator> healthAggregatorProvider,
        ObjectProvider<Map<String, HealthIndicator>> healthIndicatorsProvider,
        ObjectProvider<List<InfoContributor>> infoContributorsProvider,
        ObjectProvider<Collection<PublicMetrics>> publicMetricsProvider,
        ObjectProvider<TraceRepository> traceRepositoryProvider) {
    this.healthAggregator = healthAggregatorProvider.getIfAvailable();
    this.healthIndicators = healthIndicatorsProvider.getIfAvailable();
    this.infoContributors = infoContributorsProvider.getIfAvailable();
    this.publicMetrics = publicMetricsProvider.getIfAvailable();
    this.traceRepository = traceRepositoryProvider.getIfAvailable();
}
项目:spring-boot-concourse    文件:HealthEndpoint.java   
/**
 * Create a new {@link HealthIndicator} instance.
 * @param healthAggregator the health aggregator
 * @param healthIndicators the health indicators
 */
public HealthEndpoint(HealthAggregator healthAggregator,
        Map<String, HealthIndicator> healthIndicators) {
    super("health", false);
    Assert.notNull(healthAggregator, "HealthAggregator must not be null");
    Assert.notNull(healthIndicators, "HealthIndicators must not be null");
    CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(
            healthAggregator);
    for (Map.Entry<String, HealthIndicator> entry : healthIndicators.entrySet()) {
        healthIndicator.addHealthIndicator(getKey(entry.getKey()), entry.getValue());
    }
    this.healthIndicator = healthIndicator;
}
项目:contestparser    文件:HealthEndpoint.java   
/**
 * Create a new {@link HealthIndicator} instance.
 * @param healthAggregator the health aggregator
 * @param healthIndicators the health indicators
 */
public HealthEndpoint(HealthAggregator healthAggregator,
        Map<String, HealthIndicator> healthIndicators) {
    super("health", false);
    Assert.notNull(healthAggregator, "HealthAggregator must not be null");
    Assert.notNull(healthIndicators, "HealthIndicators must not be null");
    CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(
            healthAggregator);
    for (Map.Entry<String, HealthIndicator> entry : healthIndicators.entrySet()) {
        healthIndicator.addHealthIndicator(getKey(entry.getKey()), entry.getValue());
    }
    this.healthIndicator = healthIndicator;
}
项目:spring-cloud-commons    文件:DiscoveryCompositeHealthIndicator.java   
@Autowired
public DiscoveryCompositeHealthIndicator(HealthAggregator healthAggregator,
        List<DiscoveryHealthIndicator> indicators) {
    super(healthAggregator);
    for (DiscoveryHealthIndicator indicator : indicators) {
        Holder holder = new Holder(indicator);
        addHealthIndicator(indicator.getName(), holder);
        healthIndicators.add(holder);
    }
}
项目:spring-cloud-commons    文件:CommonsClientAutoConfiguration.java   
@Bean
@ConditionalOnProperty(value = "spring.cloud.discovery.client.composite-indicator.enabled", matchIfMissing = true)
@ConditionalOnBean(DiscoveryHealthIndicator.class)
public DiscoveryCompositeHealthIndicator discoveryCompositeHealthIndicator(
        HealthAggregator aggregator, List<DiscoveryHealthIndicator> indicators) {
    return new DiscoveryCompositeHealthIndicator(aggregator, indicators);
}
项目:ontrack    文件:SVNHealthIndicator.java   
@Autowired
public SVNHealthIndicator(ConfigurationService<SVNConfiguration> configurationService, SecurityService securityService, HealthAggregator healthAggregator, SVNService svnService, TransactionService transactionService, SVNClient svnClient) {
    super(configurationService, securityService, healthAggregator);
    this.svnService = svnService;
    this.transactionService = transactionService;
    this.svnClient = svnClient;
}
项目:ontrack    文件:GitHubHealthIndicator.java   
@Autowired
public GitHubHealthIndicator(
        ConfigurationService<GitHubEngineConfiguration> configurationService,
        SecurityService securityService,
        HealthAggregator healthAggregator,
        OntrackGitHubClientFactory gitHubClientFactory) {
    super(configurationService, securityService, healthAggregator);
    this.gitHubClientFactory = gitHubClientFactory;
}
项目:ontrack    文件:GitLabHealthIndicator.java   
@Autowired
public GitLabHealthIndicator(
        ConfigurationService<GitLabConfiguration> configurationService,
        SecurityService securityService,
        HealthAggregator healthAggregator,
        OntrackGitLabClientFactory gitLabClientFactory) {
    super(configurationService, securityService, healthAggregator);
    this.gitLabClientFactory = gitLabClientFactory;
}
项目:zipkin    文件:ZipkinServerConfiguration.java   
/** Registers health for any components, even those not in this jar. */
@Bean ZipkinHealthIndicator zipkinHealthIndicator(HealthAggregator healthAggregator) {
  return new ZipkinHealthIndicator(healthAggregator);
}
项目:zipkin    文件:ZipkinHealthIndicator.java   
ZipkinHealthIndicator(HealthAggregator healthAggregator) {
  super(healthAggregator);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthEndpointTests.java   
@Bean
public HealthEndpoint endpoint(HealthAggregator healthAggregator,
        Map<String, HealthIndicator> healthIndicators) {
    return new HealthEndpoint(healthAggregator, healthIndicators);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthEndpointTests.java   
@Bean
public HealthAggregator healthAggregator() {
    return new OrderedHealthAggregator();
}
项目:spring-boot-concourse    文件:HealthEndpointTests.java   
@Bean
public HealthEndpoint endpoint(HealthAggregator healthAggregator,
        Map<String, HealthIndicator> healthIndicators) {
    return new HealthEndpoint(healthAggregator, healthIndicators);
}
项目:spring-boot-concourse    文件:HealthEndpointTests.java   
@Bean
public HealthAggregator healthAggregator() {
    return new OrderedHealthAggregator();
}
项目:contestparser    文件:HealthEndpointTests.java   
@Bean
public HealthEndpoint endpoint(HealthAggregator healthAggregator,
        Map<String, HealthIndicator> healthIndicators) {
    return new HealthEndpoint(healthAggregator, healthIndicators);
}
项目:contestparser    文件:HealthEndpointTests.java   
@Bean
public HealthAggregator healthAggregator() {
    return new OrderedHealthAggregator();
}
项目:spring-cloud-commons    文件:DiscoveryClientHealthIndicatorTests.java   
@Bean
public HealthAggregator healthAggregator() {
    return new OrderedHealthAggregator();
}
项目:spring-cloud-commons    文件:DiscoveryCompositeHealthIndicatorTests.java   
@Bean
public HealthAggregator healthAggregator() {
    return new OrderedHealthAggregator();
}
项目:kork    文件:EurekaComponents.java   
@Bean
HealthCheckHandler healthCheckHandler(ApplicationInfoManager applicationInfoManager, HealthAggregator healthAggregator, Map<String, HealthIndicator> healthIndicators) {
  return new BootHealthCheckHandler(applicationInfoManager, healthAggregator, healthIndicators);
}
项目:kork    文件:BootHealthCheckHandler.java   
public BootHealthCheckHandler(ApplicationInfoManager applicationInfoManager,
                              HealthAggregator aggregator,
                              Map<String, HealthIndicator> healthIndicators) {
  this.applicationInfoManager = Objects.requireNonNull(applicationInfoManager, "applicationInfoManager");
  this.aggregateHealth = new CompositeHealthIndicator(aggregator, healthIndicators);
}
项目:ontrack    文件:ArtifactoryHealthIndicator.java   
@Autowired
public ArtifactoryHealthIndicator(ConfigurationService<ArtifactoryConfiguration> configurationService, SecurityService securityService, HealthAggregator healthAggregator, ArtifactoryClientFactory clientFactory) {
    super(configurationService, securityService, healthAggregator);
    this.clientFactory = clientFactory;
}
项目:ontrack    文件:SVNTestConfig.java   
@Bean
public HealthAggregator healthAggregator() {
    return new OrderedHealthAggregator();
}
项目:ontrack    文件:JenkinsHealthIndicator.java   
@Autowired
public JenkinsHealthIndicator(ConfigurationService<JenkinsConfiguration> configurationService, SecurityService securityService, HealthAggregator healthAggregator, JenkinsClientFactory jenkinsClientFactory) {
    super(configurationService, securityService, healthAggregator);
    this.jenkinsClientFactory = jenkinsClientFactory;
}
项目:ontrack    文件:GitHealthIndicator.java   
@Autowired
public GitHealthIndicator(ConfigurationService<BasicGitConfiguration> configurationService, SecurityService securityService, HealthAggregator healthAggregator, GitRepositoryClientFactory repositoryClientFactory) {
    super(configurationService, securityService, healthAggregator);
    this.repositoryClientFactory = repositoryClientFactory;
}
项目:ontrack    文件:GitTestConfig.java   
@Bean
public HealthAggregator healthAggregator() {
    return new OrderedHealthAggregator();
}
项目:ontrack    文件:ConfigurationHealthIndicator.java   
protected ConfigurationHealthIndicator(ConfigurationService<T> configurationService, SecurityService securityService, HealthAggregator healthAggregator) {
    this.configurationService = configurationService;
    this.securityService = securityService;
    this.healthAggregator = healthAggregator;
}
项目:ontrack    文件:GitHubTestConfig.java   
@Bean
public HealthAggregator healthAggregator() {
    return new OrderedHealthAggregator();
}
项目:ontrack    文件:StashTestConfig.java   
@Bean
public HealthAggregator healthAggregator() {
    return new OrderedHealthAggregator();
}
项目:ontrack    文件:JIRAHealthIndicator.java   
@Autowired
public JIRAHealthIndicator(ConfigurationService<JIRAConfiguration> configurationService, SecurityService securityService, HealthAggregator healthAggregator, JIRASessionFactory sessionFactory) {
    super(configurationService, securityService, healthAggregator);
    this.sessionFactory = sessionFactory;
}
项目:spring-cloud-netflix    文件:EurekaHealthCheckHandler.java   
public EurekaHealthCheckHandler(HealthAggregator healthAggregator) {
    Assert.notNull(healthAggregator, "HealthAggregator must not be null");
    this.healthIndicator = new CompositeHealthIndicator(healthAggregator);
}
项目:extended-actuator-health-endpoints    文件:ExtendedHealthEndpoint.java   
/**
 * Create new ExtendedHealthEndpoint.
 *
 * @param id                              part of the endpoint URL
 * @param healthAggregator                usually a new instance of OrderedHealthAggregator
 * @param indicatorMarkerInterface
 * @param excludeIndicatorMarkerInterface indicator class that should be excluded, can be null
 */
public ExtendedHealthEndpoint(String id, HealthAggregator healthAggregator, Class<T> indicatorMarkerInterface, Class<? extends HealthIndicator> excludeIndicatorMarkerInterface) {
    super(id);
    this.healthAggregator = healthAggregator;
    this.indicatorMarkerInterface = indicatorMarkerInterface;
    this.excludeIndicatorMarkerInterface = excludeIndicatorMarkerInterface;
    LOG.info("Registered ExtendedHealthEndpoint with id " + id);
}
项目:extended-actuator-health-endpoints    文件:AliveHealthEndpoint.java   
/**
 * Create new AliveHealthEndpoint.
 *
 * @param id               part of the endpoint URL
 * @param healthAggregator usually a new instance of OrderedHealthAggregator
 */
public AliveHealthEndpoint(String id, HealthAggregator healthAggregator) {
    super(id, healthAggregator, ApplicationAliveIndicator.class);
}
项目:extended-actuator-health-endpoints    文件:BasicHealthEndpoint.java   
/**
 * Create new BasicHealthEndpoint.
 *
 * @param id               part of the endpoint URL
 * @param healthAggregator usually a new instance of OrderedHealthAggregator
 */
public BasicHealthEndpoint(String id, HealthAggregator healthAggregator) {
    super(id, healthAggregator, HealthIndicator.class, DetailHealthIndicator.class);
}
项目:extended-actuator-health-endpoints    文件:DetailHealthEndpoint.java   
/**
 * Create new DetailHealthEndpoint.
 *
 * @param id               part of the endpoint URL
 * @param healthAggregator usually a new instance of OrderedHealthAggregator
 */
public DetailHealthEndpoint(String id, HealthAggregator healthAggregator) {
    super(id, healthAggregator, DetailHealthIndicator.class);
}