Polish `ObjectProvider` names
Consistently use the simple name for ObjectProvider parameter and field names. For example: `ObjectProvider<Something> something` rather than `ObjectProvider<Something> somethingProvider`
This commit is contained in:
parent
e0541d0f74
commit
3af5ae2a26
|
|
@ -44,8 +44,8 @@ public class AuditAutoConfiguration {
|
|||
private final AuditEventRepository auditEventRepository;
|
||||
|
||||
public AuditAutoConfiguration(
|
||||
ObjectProvider<AuditEventRepository> auditEventRepositoryProvider) {
|
||||
this.auditEventRepository = auditEventRepositoryProvider.getIfAvailable();
|
||||
ObjectProvider<AuditEventRepository> auditEventRepository) {
|
||||
this.auditEventRepository = auditEventRepository.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -180,8 +180,8 @@ public class CrshAutoConfiguration {
|
|||
private final ManagementServerProperties management;
|
||||
|
||||
public AuthenticationManagerAdapterConfiguration(
|
||||
ObjectProvider<ManagementServerProperties> managementProvider) {
|
||||
this.management = managementProvider.getIfAvailable();
|
||||
ObjectProvider<ManagementServerProperties> management) {
|
||||
this.management = management.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -93,17 +93,16 @@ public class EndpointAutoConfiguration {
|
|||
|
||||
private final TraceRepository traceRepository;
|
||||
|
||||
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();
|
||||
public EndpointAutoConfiguration(ObjectProvider<HealthAggregator> healthAggregator,
|
||||
ObjectProvider<Map<String, HealthIndicator>> healthIndicators,
|
||||
ObjectProvider<List<InfoContributor>> infoContributors,
|
||||
ObjectProvider<Collection<PublicMetrics>> publicMetrics,
|
||||
ObjectProvider<TraceRepository> traceRepository) {
|
||||
this.healthAggregator = healthAggregator.getIfAvailable();
|
||||
this.healthIndicators = healthIndicators.getIfAvailable();
|
||||
this.infoContributors = infoContributors.getIfAvailable();
|
||||
this.publicMetrics = publicMetrics.getIfAvailable();
|
||||
this.traceRepository = traceRepository.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ public class EndpointMBeanExportAutoConfiguration {
|
|||
private final ObjectMapper objectMapper;
|
||||
|
||||
public EndpointMBeanExportAutoConfiguration(EndpointMBeanExportProperties properties,
|
||||
ObjectProvider<ObjectMapper> objectMapperProvider) {
|
||||
ObjectProvider<ObjectMapper> objectMapper) {
|
||||
this.properties = properties;
|
||||
this.objectMapper = objectMapperProvider.getIfAvailable();
|
||||
this.objectMapper = objectMapper.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -81,11 +81,11 @@ public class EndpointWebMvcManagementContextConfiguration {
|
|||
HealthMvcEndpointProperties healthMvcEndpointProperties,
|
||||
ManagementServerProperties managementServerProperties,
|
||||
EndpointCorsProperties corsProperties,
|
||||
ObjectProvider<List<EndpointHandlerMappingCustomizer>> mappingCustomizersProvider) {
|
||||
ObjectProvider<List<EndpointHandlerMappingCustomizer>> mappingCustomizers) {
|
||||
this.healthMvcEndpointProperties = healthMvcEndpointProperties;
|
||||
this.managementServerProperties = managementServerProperties;
|
||||
this.corsProperties = corsProperties;
|
||||
List<EndpointHandlerMappingCustomizer> providedCustomizers = mappingCustomizersProvider
|
||||
List<EndpointHandlerMappingCustomizer> providedCustomizers = mappingCustomizers
|
||||
.getIfAvailable();
|
||||
this.mappingCustomizers = providedCustomizers == null
|
||||
? Collections.<EndpointHandlerMappingCustomizer>emptyList()
|
||||
|
|
|
|||
|
|
@ -186,10 +186,10 @@ public class HealthIndicatorAutoConfiguration {
|
|||
private DataSourcePoolMetadataProvider poolMetadataProvider;
|
||||
|
||||
public DataSourcesHealthIndicatorConfiguration(
|
||||
ObjectProvider<Map<String, DataSource>> dataSourcesProvider,
|
||||
ObjectProvider<Collection<DataSourcePoolMetadataProvider>> metadataProvidersProvider) {
|
||||
this.dataSources = filterDataSources(dataSourcesProvider.getIfAvailable());
|
||||
this.metadataProviders = metadataProvidersProvider.getIfAvailable();
|
||||
ObjectProvider<Map<String, DataSource>> dataSources,
|
||||
ObjectProvider<Collection<DataSourcePoolMetadataProvider>> metadataProviders) {
|
||||
this.dataSources = filterDataSources(dataSources.getIfAvailable());
|
||||
this.metadataProviders = metadataProviders.getIfAvailable();
|
||||
}
|
||||
|
||||
private Map<String, DataSource> filterDataSources(
|
||||
|
|
@ -341,8 +341,8 @@ public class HealthIndicatorAutoConfiguration {
|
|||
private final Map<String, JavaMailSenderImpl> mailSenders;
|
||||
|
||||
public MailHealthIndicatorConfiguration(
|
||||
ObjectProvider<Map<String, JavaMailSenderImpl>> mailSendersProvider) {
|
||||
this.mailSenders = mailSendersProvider.getIfAvailable();
|
||||
ObjectProvider<Map<String, JavaMailSenderImpl>> mailSenders) {
|
||||
this.mailSenders = mailSenders.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
@ -362,8 +362,8 @@ public class HealthIndicatorAutoConfiguration {
|
|||
private final Map<String, ConnectionFactory> connectionFactories;
|
||||
|
||||
public JmsHealthIndicatorConfiguration(
|
||||
ObjectProvider<Map<String, ConnectionFactory>> connectionFactoriesProvider) {
|
||||
this.connectionFactories = connectionFactoriesProvider.getIfAvailable();
|
||||
ObjectProvider<Map<String, ConnectionFactory>> connectionFactories) {
|
||||
this.connectionFactories = connectionFactories.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -100,9 +100,9 @@ public class ManagementWebSecurityAutoConfiguration {
|
|||
@Bean
|
||||
public IgnoredRequestCustomizer managementIgnoredRequestCustomizer(
|
||||
ManagementServerProperties management,
|
||||
ObjectProvider<ManagementContextResolver> contextResolverProvider) {
|
||||
ObjectProvider<ManagementContextResolver> contextResolver) {
|
||||
return new ManagementIgnoredRequestCustomizer(management,
|
||||
contextResolverProvider.getIfAvailable());
|
||||
contextResolver.getIfAvailable());
|
||||
}
|
||||
|
||||
private class ManagementIgnoredRequestCustomizer implements IgnoredRequestCustomizer {
|
||||
|
|
@ -133,22 +133,23 @@ public class ManagementWebSecurityAutoConfiguration {
|
|||
protected static class ManagementSecurityPropertiesConfiguration
|
||||
implements SecurityPrerequisite {
|
||||
|
||||
private final SecurityProperties security;
|
||||
private final SecurityProperties securityProperties;
|
||||
|
||||
private final ManagementServerProperties management;
|
||||
private final ManagementServerProperties managementServerProperties;
|
||||
|
||||
public ManagementSecurityPropertiesConfiguration(
|
||||
ObjectProvider<SecurityProperties> securityProvider,
|
||||
ObjectProvider<ManagementServerProperties> managementProvider) {
|
||||
this.security = securityProvider.getIfAvailable();
|
||||
this.management = managementProvider.getIfAvailable();
|
||||
ObjectProvider<SecurityProperties> securityProperties,
|
||||
ObjectProvider<ManagementServerProperties> managementServerProperties) {
|
||||
this.securityProperties = securityProperties.getIfAvailable();
|
||||
this.managementServerProperties = managementServerProperties.getIfAvailable();
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
if (this.management != null && this.security != null) {
|
||||
this.security.getUser().getRole()
|
||||
.addAll(this.management.getSecurity().getRoles());
|
||||
if (this.managementServerProperties != null
|
||||
&& this.securityProperties != null) {
|
||||
this.securityProperties.getUser().getRole()
|
||||
.addAll(this.managementServerProperties.getSecurity().getRoles());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -200,10 +201,10 @@ public class ManagementWebSecurityAutoConfiguration {
|
|||
|
||||
public ManagementWebSecurityConfigurerAdapter(SecurityProperties security,
|
||||
ManagementServerProperties management,
|
||||
ObjectProvider<ManagementContextResolver> contextResolverProvider) {
|
||||
ObjectProvider<ManagementContextResolver> contextResolver) {
|
||||
this.security = security;
|
||||
this.management = management;
|
||||
this.contextResolver = contextResolverProvider.getIfAvailable();
|
||||
this.contextResolver = contextResolver.getIfAvailable();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -64,14 +64,14 @@ public class MetricExportAutoConfiguration {
|
|||
private final Map<String, Exporter> exporters;
|
||||
|
||||
public MetricExportAutoConfiguration(MetricExportProperties properties,
|
||||
ObjectProvider<MetricsEndpointMetricReader> endpointReaderProvider,
|
||||
@ExportMetricReader ObjectProvider<List<MetricReader>> readersProvider,
|
||||
@ExportMetricWriter ObjectProvider<Map<String, GaugeWriter>> writersProvider,
|
||||
ObjectProvider<Map<String, Exporter>> exportersProvider) {
|
||||
this.endpointReader = endpointReaderProvider.getIfAvailable();
|
||||
this.readers = readersProvider.getIfAvailable();
|
||||
this.writers = writersProvider.getIfAvailable();
|
||||
this.exporters = exportersProvider.getIfAvailable();
|
||||
ObjectProvider<MetricsEndpointMetricReader> endpointReader,
|
||||
@ExportMetricReader ObjectProvider<List<MetricReader>> readers,
|
||||
@ExportMetricWriter ObjectProvider<Map<String, GaugeWriter>> writers,
|
||||
ObjectProvider<Map<String, Exporter>> exporters) {
|
||||
this.endpointReader = endpointReader.getIfAvailable();
|
||||
this.readers = readers.getIfAvailable();
|
||||
this.writers = writers.getIfAvailable();
|
||||
this.exporters = exporters.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ public class PublicMetricsAutoConfiguration {
|
|||
private final List<MetricReader> metricReaders;
|
||||
|
||||
public PublicMetricsAutoConfiguration(
|
||||
@ExportMetricReader ObjectProvider<List<MetricReader>> metricReadersProvider) {
|
||||
this.metricReaders = metricReadersProvider.getIfAvailable();
|
||||
@ExportMetricReader ObjectProvider<List<MetricReader>> metricReaders) {
|
||||
this.metricReaders = metricReaders.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -54,10 +54,10 @@ public class TraceWebFilterAutoConfiguration {
|
|||
|
||||
public TraceWebFilterAutoConfiguration(TraceRepository traceRepository,
|
||||
TraceProperties traceProperties,
|
||||
ObjectProvider<ErrorAttributes> errorAttributesProvider) {
|
||||
ObjectProvider<ErrorAttributes> errorAttributes) {
|
||||
this.traceRepository = traceRepository;
|
||||
this.traceProperties = traceProperties;
|
||||
this.errorAttributes = errorAttributesProvider.getIfAvailable();
|
||||
this.errorAttributes = errorAttributes.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ public class EndpointMvcIntegrationTests {
|
|||
private final List<HttpMessageConverter<?>> converters;
|
||||
|
||||
public Application(
|
||||
ObjectProvider<List<HttpMessageConverter<?>>> convertersProvider) {
|
||||
this.converters = convertersProvider.getIfAvailable();
|
||||
ObjectProvider<List<HttpMessageConverter<?>>> converters) {
|
||||
this.converters = converters.getIfAvailable();
|
||||
}
|
||||
|
||||
@RequestMapping("/{name}/{env}/{bar}")
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ public class SpringApplicationAdminJmxAutoConfiguration {
|
|||
private final Environment environment;
|
||||
|
||||
public SpringApplicationAdminJmxAutoConfiguration(
|
||||
ObjectProvider<MBeanExporter> mbeanExporterProvider,
|
||||
ObjectProvider<MBeanExporter> mbeanExporter,
|
||||
Environment environment) {
|
||||
this.mbeanExporter = mbeanExporterProvider.getIfAvailable();
|
||||
this.mbeanExporter = mbeanExporter.getIfAvailable();
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@ public class BatchAutoConfiguration {
|
|||
private final JobParametersConverter jobParametersConverter;
|
||||
|
||||
public BatchAutoConfiguration(BatchProperties properties,
|
||||
ObjectProvider<JobParametersConverter> jobParametersConverterProvider) {
|
||||
ObjectProvider<JobParametersConverter> jobParametersConverter) {
|
||||
this.properties = properties;
|
||||
this.jobParametersConverter = jobParametersConverterProvider.getIfAvailable();
|
||||
this.jobParametersConverter = jobParametersConverter.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -57,14 +57,14 @@ class CaffeineCacheConfiguration {
|
|||
|
||||
CaffeineCacheConfiguration(CacheProperties cacheProperties,
|
||||
CacheManagerCustomizers customizers,
|
||||
ObjectProvider<Caffeine<Object, Object>> caffeineProvider,
|
||||
ObjectProvider<CaffeineSpec> caffeineSpecProvider,
|
||||
ObjectProvider<CacheLoader<Object, Object>> cacheLoaderProvider) {
|
||||
ObjectProvider<Caffeine<Object, Object>> caffeine,
|
||||
ObjectProvider<CaffeineSpec> caffeineSpec,
|
||||
ObjectProvider<CacheLoader<Object, Object>> cacheLoader) {
|
||||
this.cacheProperties = cacheProperties;
|
||||
this.customizers = customizers;
|
||||
this.caffeine = caffeineProvider.getIfAvailable();
|
||||
this.caffeineSpec = caffeineSpecProvider.getIfAvailable();
|
||||
this.cacheLoader = cacheLoaderProvider.getIfAvailable();
|
||||
this.caffeine = caffeine.getIfAvailable();
|
||||
this.caffeineSpec = caffeineSpec.getIfAvailable();
|
||||
this.cacheLoader = cacheLoader.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -58,14 +58,14 @@ class GuavaCacheConfiguration {
|
|||
|
||||
GuavaCacheConfiguration(CacheProperties cacheProperties,
|
||||
CacheManagerCustomizers customizers,
|
||||
ObjectProvider<CacheBuilder<Object, Object>> cacheBuilderProvider,
|
||||
ObjectProvider<CacheBuilderSpec> cacheBuilderSpecProvider,
|
||||
ObjectProvider<CacheLoader<Object, Object>> cacheLoaderProvider) {
|
||||
ObjectProvider<CacheBuilder<Object, Object>> cacheBuilder,
|
||||
ObjectProvider<CacheBuilderSpec> cacheBuilderSpec,
|
||||
ObjectProvider<CacheLoader<Object, Object>> cacheLoader) {
|
||||
this.cacheProperties = cacheProperties;
|
||||
this.customizers = customizers;
|
||||
this.cacheBuilder = cacheBuilderProvider.getIfAvailable();
|
||||
this.cacheBuilderSpec = cacheBuilderSpecProvider.getIfAvailable();
|
||||
this.cacheLoader = cacheLoaderProvider.getIfAvailable();
|
||||
this.cacheBuilder = cacheBuilder.getIfAvailable();
|
||||
this.cacheBuilderSpec = cacheBuilderSpec.getIfAvailable();
|
||||
this.cacheLoader = cacheLoader.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -56,11 +56,10 @@ public class InfinispanCacheConfiguration {
|
|||
|
||||
public InfinispanCacheConfiguration(CacheProperties cacheProperties,
|
||||
CacheManagerCustomizers customizers,
|
||||
ObjectProvider<ConfigurationBuilder> defaultConfigurationBuilderProvider) {
|
||||
ObjectProvider<ConfigurationBuilder> defaultConfigurationBuilder) {
|
||||
this.cacheProperties = cacheProperties;
|
||||
this.customizers = customizers;
|
||||
this.defaultConfigurationBuilder = defaultConfigurationBuilderProvider
|
||||
.getIfAvailable();
|
||||
this.defaultConfigurationBuilder = defaultConfigurationBuilder.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -71,13 +71,12 @@ class JCacheCacheConfiguration {
|
|||
|
||||
JCacheCacheConfiguration(CacheProperties cacheProperties,
|
||||
CacheManagerCustomizers customizers,
|
||||
ObjectProvider<javax.cache.configuration.Configuration<?, ?>> defaultCacheConfigurationProvider,
|
||||
ObjectProvider<List<JCacheManagerCustomizer>> cacheManagerCustomizersProvider) {
|
||||
ObjectProvider<javax.cache.configuration.Configuration<?, ?>> defaultCacheConfiguration,
|
||||
ObjectProvider<List<JCacheManagerCustomizer>> cacheManagerCustomizers) {
|
||||
this.cacheProperties = cacheProperties;
|
||||
this.customizers = customizers;
|
||||
this.defaultCacheConfiguration = defaultCacheConfigurationProvider
|
||||
.getIfAvailable();
|
||||
this.cacheManagerCustomizers = cacheManagerCustomizersProvider.getIfAvailable();
|
||||
this.defaultCacheConfiguration = defaultCacheConfiguration.getIfAvailable();
|
||||
this.cacheManagerCustomizers = cacheManagerCustomizers.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -54,10 +54,9 @@ public class CassandraAutoConfiguration {
|
|||
private final List<ClusterBuilderCustomizer> builderCustomizers;
|
||||
|
||||
public CassandraAutoConfiguration(CassandraProperties properties,
|
||||
ObjectProvider<List<ClusterBuilderCustomizer>> builderCustomizersProvider) {
|
||||
ObjectProvider<List<ClusterBuilderCustomizer>> builderCustomizers) {
|
||||
this.properties = properties;
|
||||
this.builderCustomizers = builderCustomizersProvider
|
||||
.getIfAvailable();
|
||||
this.builderCustomizers = builderCustomizers.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -53,10 +53,10 @@ class SpringBootCouchbaseDataConfiguration extends AbstractCouchbaseDataConfigur
|
|||
|
||||
SpringBootCouchbaseDataConfiguration(ApplicationContext applicationContext,
|
||||
CouchbaseDataProperties properties,
|
||||
ObjectProvider<CouchbaseConfigurer> couchbaseConfigurerProvider) {
|
||||
ObjectProvider<CouchbaseConfigurer> couchbaseConfigurer) {
|
||||
this.applicationContext = applicationContext;
|
||||
this.properties = properties;
|
||||
this.couchbaseConfigurer = couchbaseConfigurerProvider.getIfAvailable();
|
||||
this.couchbaseConfigurer = couchbaseConfigurer.getIfAvailable();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -67,11 +67,10 @@ public class Neo4jDataAutoConfiguration {
|
|||
@Bean
|
||||
public SessionFactory sessionFactory(org.neo4j.ogm.config.Configuration configuration,
|
||||
ApplicationContext applicationContext,
|
||||
ObjectProvider<List<EventListener>> eventListenersProvider) {
|
||||
ObjectProvider<List<EventListener>> eventListeners) {
|
||||
SessionFactory sessionFactory = new SessionFactory(configuration,
|
||||
getPackagesToScan(applicationContext));
|
||||
List<EventListener> providedEventListeners = eventListenersProvider
|
||||
.getIfAvailable();
|
||||
List<EventListener> providedEventListeners = eventListeners.getIfAvailable();
|
||||
if (providedEventListeners != null) {
|
||||
for (EventListener eventListener : providedEventListeners) {
|
||||
sessionFactory.register(eventListener);
|
||||
|
|
|
|||
|
|
@ -78,11 +78,11 @@ public class RedisAutoConfiguration {
|
|||
private final RedisClusterConfiguration clusterConfiguration;
|
||||
|
||||
public RedisConnectionConfiguration(RedisProperties properties,
|
||||
ObjectProvider<RedisSentinelConfiguration> sentinelConfigurationProvider,
|
||||
ObjectProvider<RedisClusterConfiguration> clusterConfigurationProvider) {
|
||||
ObjectProvider<RedisSentinelConfiguration> sentinelConfiguration,
|
||||
ObjectProvider<RedisClusterConfiguration> clusterConfiguration) {
|
||||
this.properties = properties;
|
||||
this.sentinelConfiguration = sentinelConfigurationProvider.getIfAvailable();
|
||||
this.clusterConfiguration = clusterConfigurationProvider.getIfAvailable();
|
||||
this.sentinelConfiguration = sentinelConfiguration.getIfAvailable();
|
||||
this.clusterConfiguration = clusterConfiguration.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -54,12 +54,11 @@ public class JestAutoConfiguration {
|
|||
|
||||
private final List<HttpClientConfigBuilderCustomizer> builderCustomizers;
|
||||
|
||||
public JestAutoConfiguration(JestProperties properties,
|
||||
ObjectProvider<Gson> gsonProvider,
|
||||
ObjectProvider<List<HttpClientConfigBuilderCustomizer>> builderCustomizersProvider) {
|
||||
public JestAutoConfiguration(JestProperties properties, ObjectProvider<Gson> gson,
|
||||
ObjectProvider<List<HttpClientConfigBuilderCustomizer>> builderCustomizers) {
|
||||
this.properties = properties;
|
||||
this.gsonProvider = gsonProvider;
|
||||
this.builderCustomizers = builderCustomizersProvider.getIfAvailable();
|
||||
this.gsonProvider = gson;
|
||||
this.builderCustomizers = builderCustomizers.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean(destroyMethod = "shutdownClient")
|
||||
|
|
|
|||
|
|
@ -93,15 +93,14 @@ public class FlywayAutoConfiguration {
|
|||
private final FlywayMigrationStrategy migrationStrategy;
|
||||
|
||||
public FlywayConfiguration(FlywayProperties properties,
|
||||
ResourceLoader resourceLoader,
|
||||
ObjectProvider<DataSource> dataSourceProvider,
|
||||
@FlywayDataSource ObjectProvider<DataSource> flywayDataSourceProvider,
|
||||
ObjectProvider<FlywayMigrationStrategy> migrationStrategyProvider) {
|
||||
ResourceLoader resourceLoader, ObjectProvider<DataSource> dataSource,
|
||||
@FlywayDataSource ObjectProvider<DataSource> flywayDataSource,
|
||||
ObjectProvider<FlywayMigrationStrategy> migrationStrategy) {
|
||||
this.properties = properties;
|
||||
this.resourceLoader = resourceLoader;
|
||||
this.dataSource = dataSourceProvider.getIfUnique();
|
||||
this.flywayDataSource = flywayDataSourceProvider.getIfAvailable();
|
||||
this.migrationStrategy = migrationStrategyProvider.getIfAvailable();
|
||||
this.dataSource = dataSource.getIfUnique();
|
||||
this.flywayDataSource = flywayDataSource.getIfAvailable();
|
||||
this.migrationStrategy = migrationStrategy.getIfAvailable();
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
|
|
@ -185,7 +184,6 @@ public class FlywayAutoConfiguration {
|
|||
|
||||
}
|
||||
|
||||
|
||||
private static class SpringBootFlyway extends Flyway {
|
||||
|
||||
private static final String VENDOR_PLACEHOLDER = "{vendor}";
|
||||
|
|
@ -194,13 +192,12 @@ public class FlywayAutoConfiguration {
|
|||
public void setLocations(String... locations) {
|
||||
if (usesVendorLocation(locations)) {
|
||||
try {
|
||||
String url = (String) JdbcUtils.extractDatabaseMetaData(
|
||||
getDataSource(), "getURL");
|
||||
String url = (String) JdbcUtils
|
||||
.extractDatabaseMetaData(getDataSource(), "getURL");
|
||||
DatabaseDriver vendor = DatabaseDriver.fromJdbcUrl(url);
|
||||
if (vendor != DatabaseDriver.UNKNOWN) {
|
||||
for (int i = 0; i < locations.length; i++) {
|
||||
locations[i] = locations[i].replace(
|
||||
VENDOR_PLACEHOLDER,
|
||||
locations[i] = locations[i].replace(VENDOR_PLACEHOLDER,
|
||||
vendor.getId());
|
||||
}
|
||||
}
|
||||
|
|
@ -212,7 +209,6 @@ public class FlywayAutoConfiguration {
|
|||
super.setLocations(locations);
|
||||
}
|
||||
|
||||
|
||||
private boolean usesVendorLocation(String... locations) {
|
||||
for (String location : locations) {
|
||||
if (location.contains(VENDOR_PLACEHOLDER)) {
|
||||
|
|
|
|||
|
|
@ -77,10 +77,10 @@ public class GroovyTemplateAutoConfiguration {
|
|||
|
||||
public GroovyMarkupConfiguration(ApplicationContext applicationContext,
|
||||
GroovyTemplateProperties properties,
|
||||
ObjectProvider<MarkupTemplateEngine> templateEngineProvider) {
|
||||
ObjectProvider<MarkupTemplateEngine> templateEngine) {
|
||||
this.applicationContext = applicationContext;
|
||||
this.properties = properties;
|
||||
this.templateEngine = templateEngineProvider.getIfAvailable();
|
||||
this.templateEngine = templateEngine.getIfAvailable();
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
|
|
|
|||
|
|
@ -100,10 +100,10 @@ public class JerseyAutoConfiguration implements ServletContextAware {
|
|||
private String path;
|
||||
|
||||
public JerseyAutoConfiguration(JerseyProperties jersey, ResourceConfig config,
|
||||
ObjectProvider<List<ResourceConfigCustomizer>> customizersProvider) {
|
||||
ObjectProvider<List<ResourceConfigCustomizer>> customizers) {
|
||||
this.jersey = jersey;
|
||||
this.config = config;
|
||||
this.customizers = customizersProvider.getIfAvailable();
|
||||
this.customizers = customizers.getIfAvailable();
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
|
|
|
|||
|
|
@ -56,13 +56,13 @@ class ArtemisEmbeddedServerConfiguration {
|
|||
private final List<TopicConfiguration> topicsConfiguration;
|
||||
|
||||
ArtemisEmbeddedServerConfiguration(ArtemisProperties properties,
|
||||
ObjectProvider<List<ArtemisConfigurationCustomizer>> configurationCustomizersProvider,
|
||||
ObjectProvider<List<JMSQueueConfiguration>> queuesConfigurationProvider,
|
||||
ObjectProvider<List<TopicConfiguration>> topicsConfigurationProvider) {
|
||||
ObjectProvider<List<ArtemisConfigurationCustomizer>> configurationCustomizers,
|
||||
ObjectProvider<List<JMSQueueConfiguration>> queuesConfiguration,
|
||||
ObjectProvider<List<TopicConfiguration>> topicsConfiguration) {
|
||||
this.properties = properties;
|
||||
this.configurationCustomizers = configurationCustomizersProvider.getIfAvailable();
|
||||
this.queuesConfiguration = queuesConfigurationProvider.getIfAvailable();
|
||||
this.topicsConfiguration = topicsConfigurationProvider.getIfAvailable();
|
||||
this.configurationCustomizers = configurationCustomizers.getIfAvailable();
|
||||
this.queuesConfiguration = queuesConfiguration.getIfAvailable();
|
||||
this.topicsConfiguration = topicsConfiguration.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public class JooqAutoConfiguration {
|
|||
|
||||
private final JooqProperties properties;
|
||||
|
||||
private final ConnectionProvider connectionProvider;
|
||||
private final ConnectionProvider connection;
|
||||
|
||||
private final TransactionProvider transactionProvider;
|
||||
|
||||
|
|
@ -99,21 +99,20 @@ public class JooqAutoConfiguration {
|
|||
|
||||
public DslContextConfiguration(JooqProperties properties,
|
||||
ConnectionProvider connectionProvider,
|
||||
ObjectProvider<TransactionProvider> transactionProviderProvider,
|
||||
ObjectProvider<RecordMapperProvider> recordMapperProviderProvider,
|
||||
ObjectProvider<Settings> settingsProvider,
|
||||
ObjectProvider<RecordListenerProvider[]> recordListenerProvidersProvider,
|
||||
ObjectProvider<TransactionProvider> transactionProvider,
|
||||
ObjectProvider<RecordMapperProvider> recordMapperProvider,
|
||||
ObjectProvider<Settings> settings,
|
||||
ObjectProvider<RecordListenerProvider[]> recordListenerProviders,
|
||||
ExecuteListenerProvider[] executeListenerProviders,
|
||||
ObjectProvider<VisitListenerProvider[]> visitListenerProvidersProvider) {
|
||||
ObjectProvider<VisitListenerProvider[]> visitListenerProviders) {
|
||||
this.properties = properties;
|
||||
this.connectionProvider = connectionProvider;
|
||||
this.transactionProvider = transactionProviderProvider.getIfAvailable();
|
||||
this.recordMapperProvider = recordMapperProviderProvider.getIfAvailable();
|
||||
this.settings = settingsProvider.getIfAvailable();
|
||||
this.recordListenerProviders = recordListenerProvidersProvider
|
||||
.getIfAvailable();
|
||||
this.connection = connectionProvider;
|
||||
this.transactionProvider = transactionProvider.getIfAvailable();
|
||||
this.recordMapperProvider = recordMapperProvider.getIfAvailable();
|
||||
this.settings = settings.getIfAvailable();
|
||||
this.recordListenerProviders = recordListenerProviders.getIfAvailable();
|
||||
this.executeListenerProviders = executeListenerProviders;
|
||||
this.visitListenerProviders = visitListenerProvidersProvider.getIfAvailable();
|
||||
this.visitListenerProviders = visitListenerProviders.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
@ -128,7 +127,7 @@ public class JooqAutoConfiguration {
|
|||
if (this.properties.getSqlDialect() != null) {
|
||||
configuration.set(this.properties.getSqlDialect());
|
||||
}
|
||||
configuration.set(this.connectionProvider);
|
||||
configuration.set(this.connection);
|
||||
if (this.transactionProvider != null) {
|
||||
configuration.set(this.transactionProvider);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,11 +77,11 @@ public class LiquibaseAutoConfiguration {
|
|||
|
||||
public LiquibaseConfiguration(LiquibaseProperties properties,
|
||||
ResourceLoader resourceLoader, DataSource dataSource,
|
||||
@LiquibaseDataSource ObjectProvider<DataSource> liquibaseDataSourceProvider) {
|
||||
@LiquibaseDataSource ObjectProvider<DataSource> liquibaseDataSource) {
|
||||
this.properties = properties;
|
||||
this.resourceLoader = resourceLoader;
|
||||
this.dataSource = dataSource;
|
||||
this.liquibaseDataSource = liquibaseDataSourceProvider.getIfAvailable();
|
||||
this.liquibaseDataSource = liquibaseDataSource.getIfAvailable();
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
|
|
|
|||
|
|
@ -59,9 +59,9 @@ public class MailSenderAutoConfiguration {
|
|||
private final Session session;
|
||||
|
||||
public MailSenderAutoConfiguration(MailProperties properties,
|
||||
ObjectProvider<Session> sessionProvider) {
|
||||
ObjectProvider<Session> session) {
|
||||
this.properties = properties;
|
||||
this.session = sessionProvider.getIfAvailable();
|
||||
this.session = session.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@ public class MongoAutoConfiguration {
|
|||
private MongoClient mongo;
|
||||
|
||||
public MongoAutoConfiguration(MongoProperties properties,
|
||||
ObjectProvider<MongoClientOptions> optionsProvider, Environment environment) {
|
||||
ObjectProvider<MongoClientOptions> options, Environment environment) {
|
||||
this.properties = properties;
|
||||
this.options = optionsProvider.getIfAvailable();
|
||||
this.options = options.getIfAvailable();
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,8 +88,8 @@ public class HibernateJpaAutoConfiguration extends JpaBaseConfiguration {
|
|||
|
||||
public HibernateJpaAutoConfiguration(DataSource dataSource,
|
||||
JpaProperties jpaProperties,
|
||||
ObjectProvider<JtaTransactionManager> jtaTransactionManagerProvider) {
|
||||
super(dataSource, jpaProperties, jtaTransactionManagerProvider);
|
||||
ObjectProvider<JtaTransactionManager> jtaTransactionManager) {
|
||||
super(dataSource, jpaProperties, jtaTransactionManager);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware {
|
|||
private ConfigurableListableBeanFactory beanFactory;
|
||||
|
||||
protected JpaBaseConfiguration(DataSource dataSource, JpaProperties properties,
|
||||
ObjectProvider<JtaTransactionManager> jtaTransactionManagerProvider) {
|
||||
ObjectProvider<JtaTransactionManager> jtaTransactionManager) {
|
||||
this.dataSource = dataSource;
|
||||
this.properties = properties;
|
||||
this.jtaTransactionManager = jtaTransactionManagerProvider.getIfAvailable();
|
||||
this.jtaTransactionManager = jtaTransactionManager.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
@ -103,10 +103,10 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware {
|
|||
@ConditionalOnMissingBean
|
||||
public EntityManagerFactoryBuilder entityManagerFactoryBuilder(
|
||||
JpaVendorAdapter jpaVendorAdapter,
|
||||
ObjectProvider<PersistenceUnitManager> persistenceUnitManagerProvider) {
|
||||
ObjectProvider<PersistenceUnitManager> persistenceUnitManager) {
|
||||
EntityManagerFactoryBuilder builder = new EntityManagerFactoryBuilder(
|
||||
jpaVendorAdapter, this.properties.getProperties(),
|
||||
persistenceUnitManagerProvider.getIfAvailable());
|
||||
persistenceUnitManager.getIfAvailable());
|
||||
builder.setCallback(getVendorCallback());
|
||||
return builder;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,11 +78,11 @@ public class OAuth2AuthorizationServerConfiguration
|
|||
|
||||
public OAuth2AuthorizationServerConfiguration(BaseClientDetails details,
|
||||
AuthenticationManager authenticationManager,
|
||||
ObjectProvider<TokenStore> tokenStoreProvider,
|
||||
ObjectProvider<TokenStore> tokenStore,
|
||||
AuthorizationServerProperties properties) {
|
||||
this.details = details;
|
||||
this.authenticationManager = authenticationManager;
|
||||
this.tokenStore = tokenStoreProvider.getIfAvailable();
|
||||
this.tokenStore = tokenStore.getIfAvailable();
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,11 +85,10 @@ public class ResourceServerTokenServicesConfiguration {
|
|||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public UserInfoRestTemplateFactory userInfoRestTemplateFactory(
|
||||
ObjectProvider<List<UserInfoRestTemplateCustomizer>> customizersProvider,
|
||||
ObjectProvider<OAuth2ProtectedResourceDetails> detailsProvider,
|
||||
ObjectProvider<OAuth2ClientContext> oauth2ClientContextProvider) {
|
||||
return new UserInfoRestTemplateFactory(customizersProvider, detailsProvider,
|
||||
oauth2ClientContextProvider);
|
||||
ObjectProvider<List<UserInfoRestTemplateCustomizer>> customizers,
|
||||
ObjectProvider<OAuth2ProtectedResourceDetails> details,
|
||||
ObjectProvider<OAuth2ClientContext> oauth2ClientContext) {
|
||||
return new UserInfoRestTemplateFactory(customizers, details, oauth2ClientContext);
|
||||
}
|
||||
|
||||
@Configuration
|
||||
|
|
@ -133,12 +132,12 @@ public class ResourceServerTokenServicesConfiguration {
|
|||
private final PrincipalExtractor principalExtractor;
|
||||
|
||||
public SocialTokenServicesConfiguration(ResourceServerProperties sso,
|
||||
ObjectProvider<OAuth2ConnectionFactory<?>> connectionFactoryProvider,
|
||||
ObjectProvider<OAuth2ConnectionFactory<?>> connectionFactory,
|
||||
UserInfoRestTemplateFactory restTemplateFactory,
|
||||
ObjectProvider<AuthoritiesExtractor> authoritiesExtractor,
|
||||
ObjectProvider<PrincipalExtractor> principalExtractor) {
|
||||
this.sso = sso;
|
||||
this.connectionFactory = connectionFactoryProvider.getIfAvailable();
|
||||
this.connectionFactory = connectionFactory.getIfAvailable();
|
||||
this.restTemplate = restTemplateFactory.getUserInfoRestTemplate();
|
||||
this.authoritiesExtractor = authoritiesExtractor.getIfAvailable();
|
||||
this.principalExtractor = principalExtractor.getIfAvailable();
|
||||
|
|
@ -225,9 +224,9 @@ public class ResourceServerTokenServicesConfiguration {
|
|||
private final List<JwtAccessTokenConverterConfigurer> configurers;
|
||||
|
||||
public JwtTokenServicesConfiguration(ResourceServerProperties resource,
|
||||
ObjectProvider<List<JwtAccessTokenConverterConfigurer>> configurersProvider) {
|
||||
ObjectProvider<List<JwtAccessTokenConverterConfigurer>> configurers) {
|
||||
this.resource = resource;
|
||||
this.configurers = configurersProvider.getIfAvailable();
|
||||
this.configurers = configurers.getIfAvailable();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -59,12 +59,12 @@ public class UserInfoRestTemplateFactory {
|
|||
private OAuth2RestTemplate template;
|
||||
|
||||
public UserInfoRestTemplateFactory(
|
||||
ObjectProvider<List<UserInfoRestTemplateCustomizer>> customizersProvider,
|
||||
ObjectProvider<OAuth2ProtectedResourceDetails> detailsProvider,
|
||||
ObjectProvider<OAuth2ClientContext> oauth2ClientContextProvider) {
|
||||
this.customizers = customizersProvider.getIfAvailable();
|
||||
this.details = detailsProvider.getIfAvailable();
|
||||
this.oauth2ClientContext = oauth2ClientContextProvider.getIfAvailable();
|
||||
ObjectProvider<List<UserInfoRestTemplateCustomizer>> customizers,
|
||||
ObjectProvider<OAuth2ProtectedResourceDetails> details,
|
||||
ObjectProvider<OAuth2ClientContext> oauth2ClientContext) {
|
||||
this.customizers = customizers.getIfAvailable();
|
||||
this.details = details.getIfAvailable();
|
||||
this.oauth2ClientContext = oauth2ClientContext.getIfAvailable();
|
||||
}
|
||||
|
||||
public OAuth2RestTemplate getUserInfoRestTemplate() {
|
||||
|
|
|
|||
|
|
@ -57,11 +57,11 @@ public class CustomRestTemplateBasicOAuth2SsoConfigurationTests {
|
|||
private ApplicationContext applicationContext;
|
||||
|
||||
@Autowired
|
||||
private ObjectProvider<RestTemplate> restTemplateProvider;
|
||||
private ObjectProvider<RestTemplate> restTemplate;
|
||||
|
||||
@Test
|
||||
public void customRestTemplateCanBePrimary() {
|
||||
RestTemplate restTemplate = this.restTemplateProvider.getIfAvailable();
|
||||
RestTemplate restTemplate = this.restTemplate.getIfAvailable();
|
||||
verifyZeroInteractions(restTemplate);
|
||||
assertThat(this.applicationContext.getBeansOfType(RestTemplate.class)).hasSize(1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue