DATAGEODE-121 - Do not allow eager init when getting beans by type to resolve Configurers for Annotation configuration.

This commit is contained in:
John Blum
2018-06-12 19:35:17 -07:00
parent f36ad99c74
commit b02cc9803e
10 changed files with 11 additions and 50 deletions

View File

@@ -193,7 +193,7 @@ public class AddCacheServerConfiguration extends AbstractAnnotationConfigSupport
.filter(beanFactory -> beanFactory instanceof ListableBeanFactory)
.map(beanFactory -> {
Map<String, CacheServerConfigurer> beansOfType = ((ListableBeanFactory) beanFactory)
.getBeansOfType(CacheServerConfigurer.class, true, true);
.getBeansOfType(CacheServerConfigurer.class, true, false);
return nullSafeMap(beansOfType).values().stream().collect(Collectors.toList());
})

View File

@@ -198,7 +198,6 @@ public class AddPoolConfiguration extends AbstractAnnotationConfigSupport
registry.registerBeanDefinition(poolName, poolFactoryBean.getBeanDefinition());
}
/* (non-Javadoc) */
private List<PoolConfigurer> resolvePoolConfigurers() {
return Optional.ofNullable(this.poolConfigurers)
@@ -208,7 +207,7 @@ public class AddPoolConfiguration extends AbstractAnnotationConfigSupport
.filter(beanFactory -> beanFactory instanceof ListableBeanFactory)
.map(beanFactory -> {
Map<String, PoolConfigurer> beansOfType = ((ListableBeanFactory) beanFactory)
.getBeansOfType(PoolConfigurer.class, true, true);
.getBeansOfType(PoolConfigurer.class, true, false);
return nullSafeMap(beansOfType).values().stream().collect(Collectors.toList());
})
@@ -243,7 +242,6 @@ public class AddPoolConfiguration extends AbstractAnnotationConfigSupport
return poolFactoryBean;
}
/* (non-Javadoc) */
protected BeanDefinitionBuilder configurePoolLocators(String poolName, Map<String, Object> enablePoolAttributes,
BeanDefinitionBuilder poolFactoryBean) {
@@ -261,7 +259,6 @@ public class AddPoolConfiguration extends AbstractAnnotationConfigSupport
return poolFactoryBean;
}
/* (non-Javadoc) */
protected BeanDefinitionBuilder configurePoolServers(String poolName, Map<String, Object> enablePoolAttributes,
BeanDefinitionBuilder poolFactoryBean) {
@@ -279,7 +276,6 @@ public class AddPoolConfiguration extends AbstractAnnotationConfigSupport
return poolFactoryBean;
}
/* (non-Javadoc) */
protected ConnectionEndpointList parseConnectionEndpoints(Map<String, Object> enablePoolAttributes,
String arrayAttributeName, String stringAttributeName, int defaultPort) {
@@ -301,12 +297,10 @@ public class AddPoolConfiguration extends AbstractAnnotationConfigSupport
return connectionEndpoints;
}
/* (non-Javadoc) */
protected ConnectionEndpoint newConnectionEndpoint(String host, Integer port) {
return new ConnectionEndpoint(host, port);
}
/* (non-Javadoc) */
@Override
protected Class getAnnotationType() {
return EnablePool.class;

View File

@@ -141,7 +141,6 @@ public class CacheServerConfiguration extends PeerCacheConfiguration {
return gemfireCacheServer;
}
/* (non-Javadoc) */
private List<CacheServerConfigurer> resolveCacheServerConfigurers() {
return Optional.ofNullable(this.cacheServerConfigurers)
@@ -153,7 +152,7 @@ public class CacheServerConfiguration extends PeerCacheConfiguration {
.map(beanFactory -> {
Map<String, CacheServerConfigurer> beansOfType = ((ListableBeanFactory) beanFactory)
.getBeansOfType(CacheServerConfigurer.class, true, true);
.getBeansOfType(CacheServerConfigurer.class, true, false);
return nullSafeMap(beansOfType).values().stream().collect(Collectors.toList());

View File

@@ -166,7 +166,7 @@ public class ClientCacheConfiguration extends AbstractCacheConfiguration {
.map(beanFactory -> {
Map<String, ClientCacheConfigurer> beansOfType = ((ListableBeanFactory) beanFactory)
.getBeansOfType(ClientCacheConfigurer.class, true, true);
.getBeansOfType(ClientCacheConfigurer.class, true, false);
return nullSafeMap(beansOfType).values().stream().collect(Collectors.toList());

View File

@@ -224,7 +224,7 @@ public class ContinuousQueryConfiguration extends AbstractAnnotationConfigSuppor
Map<String, ContinuousQueryListenerContainerConfigurer> beansOfType =
((ListableBeanFactory) beanFactory).getBeansOfType(ContinuousQueryListenerContainerConfigurer.class,
true, true);
true, false);
return nullSafeMap(beansOfType).values().stream().collect(Collectors.toList());

View File

@@ -216,7 +216,7 @@ public class DiskStoreConfiguration extends AbstractAnnotationConfigSupport
.map(beanFactory -> {
Map<String, DiskStoreConfigurer> beansOfType = ((ListableBeanFactory) beanFactory)
.getBeansOfType(DiskStoreConfigurer.class, true, true);
.getBeansOfType(DiskStoreConfigurer.class, true, false);
return nullSafeMap(beansOfType).values().stream().collect(Collectors.toList());

View File

@@ -364,7 +364,7 @@ public class EntityDefinedRegionsConfiguration extends AbstractAnnotationConfigS
.map(beanFactory -> {
Map<String, RegionConfigurer> beansOfType = ((ListableBeanFactory) beanFactory)
.getBeansOfType(RegionConfigurer.class, true, true);
.getBeansOfType(RegionConfigurer.class, true, false);
return nullSafeMap(beansOfType).values().stream().collect(Collectors.toList());

View File

@@ -308,7 +308,7 @@ public class IndexConfiguration extends EntityDefinedRegionsConfiguration {
.filter(beanFactory -> beanFactory instanceof ListableBeanFactory)
.map(beanFactory -> {
Map<String, IndexConfigurer> beansOfType = ((ListableBeanFactory) beanFactory)
.getBeansOfType(IndexConfigurer.class, true, true);
.getBeansOfType(IndexConfigurer.class, true, false);
return nullSafeMap(beansOfType).values().stream().collect(Collectors.toList());
})

View File

@@ -101,7 +101,6 @@ public class PeerCacheConfiguration extends AbstractCacheConfiguration {
return gemfireCache;
}
/* (non-Javadoc) */
private List<PeerCacheConfigurer> resolvePeerCacheConfigurers() {
return Optional.ofNullable(this.peerCacheConfigurers)
@@ -113,7 +112,7 @@ public class PeerCacheConfiguration extends AbstractCacheConfiguration {
.map(beanFactory -> {
Map<String, PeerCacheConfigurer> beansOfType = ((ListableBeanFactory) beanFactory)
.getBeansOfType(PeerCacheConfigurer.class, true, true);
.getBeansOfType(PeerCacheConfigurer.class, true, false);
return nullSafeMap(beansOfType).values().stream().collect(Collectors.toList());