org.springframework.data.gemfire
Class CacheFactoryBean
java.lang.Object
org.springframework.data.gemfire.CacheFactoryBean
- All Implemented Interfaces:
- BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, FactoryBean<Cache>, InitializingBean, PersistenceExceptionTranslator
public class CacheFactoryBean
- extends Object
- implements BeanNameAware, BeanFactoryAware, BeanClassLoaderAware, DisposableBean, InitializingBean, FactoryBean<Cache>, PersistenceExceptionTranslator
Factory used for configuring a Gemfire Cache manager. Allows either retrieval of an existing, opened cache
or the creation of a new one.
This class implements the PersistenceExceptionTranslator
interface, as auto-detected by Spring's
PersistenceExceptionTranslationPostProcessor
,
for AOP-based translation of native exceptions to Spring DataAccessExceptions.
Hence, the presence of this class automatically enables
a PersistenceExceptionTranslationPostProcessor to translate GemFire exceptions.
- Author:
- Costin Leau
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CacheFactoryBean
public CacheFactoryBean()
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Specified by:
afterPropertiesSet
in interface InitializingBean
- Throws:
Exception
destroy
public void destroy()
throws Exception
- Specified by:
destroy
in interface DisposableBean
- Throws:
Exception
translateExceptionIfPossible
public DataAccessException translateExceptionIfPossible(RuntimeException ex)
- Specified by:
translateExceptionIfPossible
in interface PersistenceExceptionTranslator
getObject
public Cache getObject()
throws Exception
- Specified by:
getObject
in interface FactoryBean<Cache>
- Throws:
Exception
getObjectType
public Class<? extends Cache> getObjectType()
- Specified by:
getObjectType
in interface FactoryBean<Cache>
isSingleton
public boolean isSingleton()
- Specified by:
isSingleton
in interface FactoryBean<Cache>
setBeanClassLoader
public void setBeanClassLoader(ClassLoader classLoader)
- Specified by:
setBeanClassLoader
in interface BeanClassLoaderAware
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
throws BeansException
- Specified by:
setBeanFactory
in interface BeanFactoryAware
- Throws:
BeansException
setBeanName
public void setBeanName(String name)
- Specified by:
setBeanName
in interface BeanNameAware
setProperties
public void setProperties(Properties properties)
- Sets the cache properties.
- Parameters:
properties
- the properties to set
setCacheXml
public void setCacheXml(Resource cacheXml)
- Sets the cache configuration.
- Parameters:
cacheXml
- the cacheXml to set
Copyright © 2010 SpringSource, a division of VMware. All Rights Reserved.