SGF-479 - Remove lazy initialization option for configuring a GemFire cache.

This commit is contained in:
John Blum
2016-03-09 20:19:39 -08:00
parent 6bf5ceeaf6
commit b052f0ac8d
35 changed files with 145 additions and 261 deletions

View File

@@ -88,7 +88,6 @@ public class CacheFactoryBean implements BeanClassLoaderAware, BeanFactoryAware,
InitializingBean, DisposableBean, PersistenceExceptionTranslator {
protected boolean close = true;
protected boolean lazyInitialize = true;
protected boolean useBeanFactoryLocator = false;
protected final Log log = LogFactory.getLog(getClass());
@@ -215,10 +214,7 @@ public class CacheFactoryBean implements BeanClassLoaderAware, BeanFactoryAware,
@Override
public void afterPropertiesSet() throws Exception {
postProcessPropertiesBeforeInitialization(getProperties());
if (!isLazyInitialize()) {
init();
}
init();
}
/* (non-Javadoc) */
@@ -579,13 +575,6 @@ public class CacheFactoryBean implements BeanClassLoaderAware, BeanFactoryAware,
this.properties = properties;
}
/**
* @param lazyInitialize set to false to force cache initialization if no other bean references it
*/
public void setLazyInitialize(boolean lazyInitialize) {
this.lazyInitialize = lazyInitialize;
}
/**
* Indicates whether a bean factory locator is enabled (default) for this
* cache definition or not. The locator stores the enclosing bean factory
@@ -868,7 +857,7 @@ public class CacheFactoryBean implements BeanClassLoaderAware, BeanFactoryAware,
@Override
public Cache getObject() throws Exception {
return init();
return cache;
}
@Override
@@ -1019,13 +1008,4 @@ public class CacheFactoryBean implements BeanClassLoaderAware, BeanFactoryAware,
return this.useClusterConfiguration;
}
/**
* Determines whether this Cache instance will be lazily initialized.
*
* @return a boolean value indicating whether this Cache instance will be lazily initialized.
*/
public boolean isLazyInitialize() {
return lazyInitialize;
}
}

View File

@@ -60,7 +60,6 @@ class CacheParser extends AbstractSimpleBeanDefinitionParser {
ParsingUtils.setPropertyValue(element, builder, "cache-xml-location", "cacheXml");
ParsingUtils.setPropertyReference(element, builder, "properties-ref", "properties");
ParsingUtils.setPropertyValue(element, builder, "lazy-init","lazyInitialize");
ParsingUtils.setPropertyValue(element, builder, "use-bean-factory-locator");
ParsingUtils.setPropertyValue(element, builder, "close");
ParsingUtils.setPropertyValue(element, builder, "copy-on-read");