SGF-479 - Remove lazy initialization option for configuring a GemFire cache.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -133,14 +133,6 @@ consider using a dedicated utility such as the <util:*/> namespace and its 'prop
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="lazy-init" default="true">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Determines if the cache should be initialized automatically. Normally the cache will be lazily initialized, i.e., during creation of another bean references it.
|
||||
For cases in which there are no declared dependencies on the cache, set this attribute to false.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="use-bean-factory-locator" type="xsd:string" use="optional" default="false">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
|
||||
Reference in New Issue
Block a user