Browse Source

Merge branch '2.1.x'

pull/15859/head
Stephane Nicoll 7 years ago
parent
commit
002fa405a8
  1. 7
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cache/CachesEndpointAutoConfiguration.java
  2. 14
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorAutoConfiguration.java
  3. 7
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthIndicatorAutoConfiguration.java
  4. 7
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthIndicatorAutoConfiguration.java
  5. 7
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/mail/MailHealthIndicatorAutoConfiguration.java
  6. 7
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfiguration.java
  7. 7
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/JspTemplateAvailabilityProvider.java

7
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cache/CachesEndpointAutoConfiguration.java vendored

@ -16,10 +16,8 @@
package org.springframework.boot.actuate.autoconfigure.cache; package org.springframework.boot.actuate.autoconfigure.cache;
import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnEnabledEndpoint; import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnEnabledEndpoint;
import org.springframework.boot.actuate.cache.CachesEndpoint; import org.springframework.boot.actuate.cache.CachesEndpoint;
import org.springframework.boot.actuate.cache.CachesEndpointWebExtension; import org.springframework.boot.actuate.cache.CachesEndpointWebExtension;
@ -48,9 +46,8 @@ public class CachesEndpointAutoConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public CachesEndpoint cachesEndpoint( public CachesEndpoint cachesEndpoint(Map<String, CacheManager> cacheManagers) {
ObjectProvider<Map<String, CacheManager>> cacheManagers) { return new CachesEndpoint(cacheManagers);
return new CachesEndpoint(cacheManagers.getIfAvailable(LinkedHashMap::new));
} }
@Bean @Bean

14
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorAutoConfiguration.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2018 the original author or authors. * Copyright 2012-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -16,12 +16,10 @@
package org.springframework.boot.actuate.autoconfigure.health; package org.springframework.boot.actuate.autoconfigure.health;
import java.util.Collections;
import java.util.Map; import java.util.Map;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.health.HealthAggregator; import org.springframework.boot.actuate.health.HealthAggregator;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthIndicator;
@ -87,13 +85,11 @@ public class HealthIndicatorAutoConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public ReactiveHealthIndicatorRegistry reactiveHealthIndicatorRegistry( public ReactiveHealthIndicatorRegistry reactiveHealthIndicatorRegistry(
ObjectProvider<Map<String, ReactiveHealthIndicator>> reactiveHealthIndicators, Map<String, ReactiveHealthIndicator> reactiveHealthIndicators,
ObjectProvider<Map<String, HealthIndicator>> healthIndicators) { Map<String, HealthIndicator> healthIndicators) {
return new ReactiveHealthIndicatorRegistryFactory() return new ReactiveHealthIndicatorRegistryFactory()
.createReactiveHealthIndicatorRegistry( .createReactiveHealthIndicatorRegistry(reactiveHealthIndicators,
reactiveHealthIndicators healthIndicators);
.getIfAvailable(Collections::emptyMap),
healthIndicators.getIfAvailable(Collections::emptyMap));
} }
} }

7
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthIndicatorAutoConfiguration.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2018 the original author or authors. * Copyright 2012-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -72,10 +72,9 @@ public class DataSourceHealthIndicatorAutoConfiguration extends
private DataSourcePoolMetadataProvider poolMetadataProvider; private DataSourcePoolMetadataProvider poolMetadataProvider;
public DataSourceHealthIndicatorAutoConfiguration( public DataSourceHealthIndicatorAutoConfiguration(Map<String, DataSource> dataSources,
ObjectProvider<Map<String, DataSource>> dataSources,
ObjectProvider<DataSourcePoolMetadataProvider> metadataProviders) { ObjectProvider<DataSourcePoolMetadataProvider> metadataProviders) {
this.dataSources = filterDataSources(dataSources.getIfAvailable()); this.dataSources = filterDataSources(dataSources);
this.metadataProviders = metadataProviders.orderedStream() this.metadataProviders = metadataProviders.orderedStream()
.collect(Collectors.toList()); .collect(Collectors.toList());
} }

7
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthIndicatorAutoConfiguration.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -20,7 +20,6 @@ import java.util.Map;
import javax.jms.ConnectionFactory; import javax.jms.ConnectionFactory;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
@ -55,8 +54,8 @@ public class JmsHealthIndicatorAutoConfiguration extends
private final Map<String, ConnectionFactory> connectionFactories; private final Map<String, ConnectionFactory> connectionFactories;
public JmsHealthIndicatorAutoConfiguration( public JmsHealthIndicatorAutoConfiguration(
ObjectProvider<Map<String, ConnectionFactory>> connectionFactories) { Map<String, ConnectionFactory> connectionFactories) {
this.connectionFactories = connectionFactories.getIfAvailable(); this.connectionFactories = connectionFactories;
} }
@Bean @Bean

7
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/mail/MailHealthIndicatorAutoConfiguration.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -18,7 +18,6 @@ package org.springframework.boot.actuate.autoconfigure.mail;
import java.util.Map; import java.util.Map;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
@ -53,8 +52,8 @@ public class MailHealthIndicatorAutoConfiguration extends
private final Map<String, JavaMailSenderImpl> mailSenders; private final Map<String, JavaMailSenderImpl> mailSenders;
public MailHealthIndicatorAutoConfiguration( public MailHealthIndicatorAutoConfiguration(
ObjectProvider<Map<String, JavaMailSenderImpl>> mailSenders) { Map<String, JavaMailSenderImpl> mailSenders) {
this.mailSenders = mailSenders.getIfAvailable(); this.mailSenders = mailSenders;
} }
@Bean @Bean

7
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfiguration.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2018 the original author or authors. * Copyright 2012-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -74,13 +74,12 @@ public class QuartzAutoConfiguration {
public QuartzAutoConfiguration(QuartzProperties properties, public QuartzAutoConfiguration(QuartzProperties properties,
ObjectProvider<SchedulerFactoryBeanCustomizer> customizers, ObjectProvider<SchedulerFactoryBeanCustomizer> customizers,
ObjectProvider<JobDetail[]> jobDetails, ObjectProvider<JobDetail[]> jobDetails, Map<String, Calendar> calendars,
ObjectProvider<Map<String, Calendar>> calendars,
ObjectProvider<Trigger[]> triggers, ApplicationContext applicationContext) { ObjectProvider<Trigger[]> triggers, ApplicationContext applicationContext) {
this.properties = properties; this.properties = properties;
this.customizers = customizers; this.customizers = customizers;
this.jobDetails = jobDetails.getIfAvailable(); this.jobDetails = jobDetails.getIfAvailable();
this.calendars = calendars.getIfAvailable(); this.calendars = calendars;
this.triggers = triggers.getIfAvailable(); this.triggers = triggers.getIfAvailable();
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
} }

7
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/JspTemplateAvailabilityProvider.java

@ -17,6 +17,7 @@
package org.springframework.boot.autoconfigure.web.servlet; package org.springframework.boot.autoconfigure.web.servlet;
import java.io.File; import java.io.File;
import java.security.AccessControlException;
import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider; import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
@ -42,7 +43,11 @@ public class JspTemplateAvailabilityProvider implements TemplateAvailabilityProv
if (resourceLoader.getResource(resourceName).exists()) { if (resourceLoader.getResource(resourceName).exists()) {
return true; return true;
} }
return new File("src/main/webapp", resourceName).exists(); try {
return new File("src/main/webapp", resourceName).exists();
}
catch (AccessControlException ex) {
}
} }
return false; return false;
} }

Loading…
Cancel
Save