|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.data.gemfire.CacheFactoryBean
public class CacheFactoryBean
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.
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
log
|
protected String |
pdxDiskStoreName
|
protected Boolean |
pdxIgnoreUnreadFields
|
protected Boolean |
pdxPersistent
|
protected Boolean |
pdxReadSerialized
|
protected Object |
pdxSerializer
|
Constructor Summary | |
---|---|
CacheFactoryBean()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
protected void |
applyPdxOptions(Object factory)
Sets the PDX properties for the given object. |
protected GemFireCache |
createCache(Object factory)
|
protected Object |
createFactory(Properties props)
|
void |
destroy()
|
protected GemFireCache |
fetchCache()
|
protected BeanFactory |
getBeanFactory()
|
GemFireCache |
getObject()
|
Class<? extends GemFireCache> |
getObjectType()
|
boolean |
isSingleton()
|
protected Properties |
mergeProperties()
|
void |
setBeanClassLoader(ClassLoader classLoader)
|
void |
setBeanFactory(BeanFactory beanFactory)
|
void |
setBeanName(String name)
|
void |
setCacheXml(Resource cacheXml)
Sets the cache configuration. |
void |
setPdxDiskStoreName(String pdxDiskStoreName)
Set the disk store that is used for PDX meta data. |
void |
setPdxIgnoreUnreadFields(Boolean pdxIgnoreUnreadFields)
Controls whether pdx ignores fields that were unread during deserialization. |
void |
setPdxPersistent(Boolean pdxPersistent)
Sets the object preference to PdxInstance type. |
void |
setPdxReadSerialized(Boolean pdxReadSerialized)
Controls whether the type metadata for PDX objects is persisted to disk. |
void |
setPdxSerializer(Object serializer)
Sets the PdxSerializable for this cache. |
void |
setProperties(Properties properties)
Sets the cache properties. |
void |
setUseBeanFactoryLocator(boolean usage)
Indicates whether a bean factory locator is enabled (default) for this cache definition or not. |
DataAccessException |
translateExceptionIfPossible(RuntimeException ex)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log log
protected Object pdxSerializer
protected Boolean pdxPersistent
protected Boolean pdxReadSerialized
protected Boolean pdxIgnoreUnreadFields
protected String pdxDiskStoreName
Constructor Detail |
---|
public CacheFactoryBean()
Method Detail |
---|
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
protected void applyPdxOptions(Object factory)
factory
- protected Object createFactory(Properties props)
protected GemFireCache fetchCache()
protected GemFireCache createCache(Object factory)
protected Properties mergeProperties()
public void destroy() throws Exception
destroy
in interface DisposableBean
Exception
public DataAccessException translateExceptionIfPossible(RuntimeException ex)
translateExceptionIfPossible
in interface PersistenceExceptionTranslator
public GemFireCache getObject() throws Exception
getObject
in interface FactoryBean<GemFireCache>
Exception
public Class<? extends GemFireCache> getObjectType()
getObjectType
in interface FactoryBean<GemFireCache>
public boolean isSingleton()
isSingleton
in interface FactoryBean<GemFireCache>
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
public void setBeanName(String name)
setBeanName
in interface BeanNameAware
public void setProperties(Properties properties)
properties
- the properties to setpublic void setCacheXml(Resource cacheXml)
cacheXml
- the cacheXml to setpublic void setUseBeanFactoryLocator(boolean usage)
usage
- true if the bean factory locator is used underneath or notpublic void setPdxSerializer(Object serializer)
PdxSerializable
for this cache. Applicable on GemFire 6.6 or higher.
The argument is of type object for compatibility with GemFire 6.5.
serializer
- pdx serializer configured for this cache.public void setPdxPersistent(Boolean pdxPersistent)
pdxPersistent
- the pdxPersistent to setpublic void setPdxReadSerialized(Boolean pdxReadSerialized)
pdxReadSerialized
- the pdxReadSerialized to setpublic void setPdxIgnoreUnreadFields(Boolean pdxIgnoreUnreadFields)
pdxIgnoreUnreadFields
- the pdxIgnoreUnreadFields to setpublic void setPdxDiskStoreName(String pdxDiskStoreName)
pdxDiskStoreName
- the pdxDiskStoreName to setprotected BeanFactory getBeanFactory()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |