Skip to content

Commit

Permalink
Make internal fields lowercase after accidental renaming (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
gavlyukovskiy authored Nov 8, 2024
1 parent d1aca35 commit 0e8878d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ public FlexyPoolConfigurationBuilderCustomizer flexyPoolConfigurationBuilderCust
static class HikariFlexyConfiguration {

@Autowired(required = false)
private List<ConnectionAcquisitionStrategyFactory<?, HikariDataSource>> ConnectionAcquisitionStrategyFactories;
private List<ConnectionAcquisitionStrategyFactory<?, HikariDataSource>> connectionAcquisitionStrategyFactories;
@Autowired
private DataSourceDecoratorProperties dataSourceDecoratorProperties;

@Bean
public FlexyPoolDataSourceDecorator flexyPoolDataSourceDecorator() {
return new FlexyPoolDataSourceDecorator(
mergeFactories(ConnectionAcquisitionStrategyFactories, dataSourceDecoratorProperties.getFlexyPool()),
mergeFactories(connectionAcquisitionStrategyFactories, dataSourceDecoratorProperties.getFlexyPool()),
HikariCPPoolAdapter.FACTORY, HikariDataSource.class);
}
}
Expand All @@ -171,14 +171,14 @@ public FlexyPoolDataSourceDecorator flexyPoolDataSourceDecorator() {
static class TomcatFlexyConfiguration {

@Autowired(required = false)
private List<ConnectionAcquisitionStrategyFactory<?, org.apache.tomcat.jdbc.pool.DataSource>> ConnectionAcquisitionStrategyFactories;
private List<ConnectionAcquisitionStrategyFactory<?, org.apache.tomcat.jdbc.pool.DataSource>> connectionAcquisitionStrategyFactories;
@Autowired
private DataSourceDecoratorProperties dataSourceDecoratorProperties;

@Bean
public FlexyPoolDataSourceDecorator flexyPoolDataSourceDecorator() {
return new FlexyPoolDataSourceDecorator(
mergeFactories(ConnectionAcquisitionStrategyFactories, dataSourceDecoratorProperties.getFlexyPool()),
mergeFactories(connectionAcquisitionStrategyFactories, dataSourceDecoratorProperties.getFlexyPool()),
TomcatCPPoolAdapter.FACTORY, org.apache.tomcat.jdbc.pool.DataSource.class);
}
}
Expand All @@ -190,14 +190,14 @@ public FlexyPoolDataSourceDecorator flexyPoolDataSourceDecorator() {
static class Dbcp2FlexyConfiguration {

@Autowired(required = false)
private List<ConnectionAcquisitionStrategyFactory<?, BasicDataSource>> ConnectionAcquisitionStrategyFactories;
private List<ConnectionAcquisitionStrategyFactory<?, BasicDataSource>> connectionAcquisitionStrategyFactories;
@Autowired
private DataSourceDecoratorProperties dataSourceDecoratorProperties;

@Bean
public FlexyPoolDataSourceDecorator flexyPoolDataSourceDecorator() {
return new FlexyPoolDataSourceDecorator(
mergeFactories(ConnectionAcquisitionStrategyFactories, dataSourceDecoratorProperties.getFlexyPool()),
mergeFactories(connectionAcquisitionStrategyFactories, dataSourceDecoratorProperties.getFlexyPool()),
DBCP2PoolAdapter.FACTORY, BasicDataSource.class);
}
}
Expand All @@ -210,11 +210,11 @@ static class PropertyFlexyConfiguration {
private static final Logger log = getLogger(PropertyFlexyConfiguration.class);

@Autowired(required = false)
private List<ConnectionAcquisitionStrategyFactory<?, javax.sql.DataSource>> ConnectionAcquisitionStrategyFactories;
private List<ConnectionAcquisitionStrategyFactory<?, javax.sql.DataSource>> connectionAcquisitionStrategyFactories;

@PostConstruct
public void warnIfAnyStrategyFound() {
if (ConnectionAcquisitionStrategyFactories != null) {
if (connectionAcquisitionStrategyFactories != null) {
log.warn("ConnectionAcquisitionStrategyFactory beans found in the context will not be applied to " +
"FlexyDataSource due to property based configuration of FlexyPool");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
public class FlexyPoolDataSourceDecorator implements DataSourceDecorator, Ordered {

private final ConnectionAcquisitionStrategyFactory<?, DataSource>[] ConnectionAcquisitionStrategyFactories;
private final ConnectionAcquisitionStrategyFactory<?, DataSource>[] connectionAcquisitionStrategyFactories;
private final PoolAdapterFactory<DataSource> poolAdapterFactory;
private final Class<DataSource> dataSourceClass;

Expand All @@ -44,17 +44,17 @@ public class FlexyPoolDataSourceDecorator implements DataSourceDecorator, Ordere

@SuppressWarnings("unchecked")
<T extends DataSource> FlexyPoolDataSourceDecorator(
List<ConnectionAcquisitionStrategyFactory<?, T>> ConnectionAcquisitionStrategyFactories,
List<ConnectionAcquisitionStrategyFactory<?, T>> connectionAcquisitionStrategyFactories,
PoolAdapterFactory<T> poolAdapterFactory,
Class<T> dataSourceClass) {
this.ConnectionAcquisitionStrategyFactories = (ConnectionAcquisitionStrategyFactory<?, DataSource>[])
ConnectionAcquisitionStrategyFactories.toArray(new ConnectionAcquisitionStrategyFactory[0]);
this.connectionAcquisitionStrategyFactories = (ConnectionAcquisitionStrategyFactory<?, DataSource>[])
connectionAcquisitionStrategyFactories.toArray(new ConnectionAcquisitionStrategyFactory[0]);
this.poolAdapterFactory = (PoolAdapterFactory<DataSource>) poolAdapterFactory;
this.dataSourceClass = (Class<DataSource>) dataSourceClass;
}

FlexyPoolDataSourceDecorator() {
ConnectionAcquisitionStrategyFactories = null;
connectionAcquisitionStrategyFactories = null;
poolAdapterFactory = null;
dataSourceClass = null;
}
Expand All @@ -76,7 +76,7 @@ public DataSource decorate(String beanName, DataSource dataSource) {
if (customizers != null) {
customizers.forEach(customizer -> customizer.customize(beanName, configurationBuilder, dataSourceClass));
}
FlexyPoolDataSource<DataSource> flexyPoolDataSource = new FlexyPoolDataSource<>(configurationBuilder.build(), ConnectionAcquisitionStrategyFactories);
FlexyPoolDataSource<DataSource> flexyPoolDataSource = new FlexyPoolDataSource<>(configurationBuilder.build(), connectionAcquisitionStrategyFactories);
flexyPoolDataSource.start();
return flexyPoolDataSource;
}
Expand Down

0 comments on commit 0e8878d

Please sign in to comment.