Class AbstractBasicCacheFactoryBean

java.lang.Object
org.springframework.data.gemfire.support.AbstractFactoryBeanSupport<GemFireCache>
org.springframework.data.gemfire.AbstractBasicCacheFactoryBean
All Implemented Interfaces:
Aware, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, FactoryBean<GemFireCache>, InitializingBean, Phased, PersistenceExceptionTranslator
Direct Known Subclasses:
AbstractConfigurableCacheFactoryBean

public abstract class AbstractBasicCacheFactoryBean extends AbstractFactoryBeanSupport<GemFireCache> implements DisposableBean, InitializingBean, PersistenceExceptionTranslator, Phased
Abstract base class for CacheFactoryBean and ClientCacheFactoryBean classes, used to create Apache Geode peer Cache and ClientCache instances, respectively. This class implements Spring's PersistenceExceptionTranslator interface and is auto-detected by Spring's PersistenceExceptionTranslationPostProcessor to enable AOP-based translation of native Apache Geode RuntimeExceptions to Spring's DataAccessException hierarchy. Therefore, the presence of this class automatically enables Spring's PersistenceExceptionTranslationPostProcessor to translate native Apache Geode thrown GemFireException and GemFireCheckedException types as Spring DataAccessExceptions. In addition, this class also assumes the responsibility of positioning the creation of the cache in the appropriate phase of the Spring container's lifecycle, providing default callbacks for both initialization and destruction. More importantly, this abstract class encapsulates configuration applicable to tuning Apache Geode in order to efficiently use JVM Heap memory. Since Apache Geode stores data in-memory, on the JVM Heap, it is important that Apache Geode be tuned to monitor the JVM Heap and respond to memory pressure accordingly, by evicting data and issuing warnings when the JVM Heap reaches critical mass. This abstract class is also concerned with the configuration of PDX and transaction event handling along with whether the contents (entries) of the cache should be made effectively immutable on reads (i.e. get(key)). In summary, this abstract class primarily handles and encapsulates the configuration of the following concerns:
  • copy-on-read semantics
  • JVM Heap memory management
  • PDX serialization
  • Transaction event processing
All of these concerns are applicable to both Apache Geode ClientCache and peer Cache instances.
Since:
2.5.0
Author:
John Blum
See Also: