@Configuration public abstract class AbstractCacheConfiguration extends Object implements BeanClassLoaderAware, BeanFactoryAware, ImportAware
AbstractCacheConfiguration is an abstract base class for configuring either a Pivotal GemFire/Apache Geode
client or peer-based cache instance using Spring's Java-based, Annotation
Configuration support.
This class encapsulates configuration settings common to both GemFire peer
caches and
client caches.BeanClassLoaderAware,
BeanFactory,
BeanFactoryAware,
Bean,
Configuration,
ImportAware,
Resource,
AnnotationMetadata,
CacheFactoryBean| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
DEFAULT_CLOSE |
protected static boolean |
DEFAULT_COPY_ON_READ |
protected static String |
DEFAULT_LOCATORS |
protected static String |
DEFAULT_LOG_LEVEL |
protected static int |
DEFAULT_MCAST_PORT |
protected static String |
DEFAULT_NAME |
protected static boolean |
DEFAULT_USE_BEAN_FACTORY_LOCATOR |
| Constructor and Description |
|---|
AbstractCacheConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Properties gemfireProperties) |
protected ClassLoader |
beanClassLoader()
Returns a reference to the
ClassLoader use by the Spring BeanFactory to load classes
for bean definitions. |
protected BeanFactory |
beanFactory()
Returns a reference to the Spring
BeanFactory in the current application context. |
protected Resource |
cacheXml() |
protected boolean |
close() |
protected void |
configureCache(AnnotationMetadata importMetadata)
Configures the GemFire cache settings.
|
protected void |
configureInfrastructure(AnnotationMetadata importMetadata)
Configures Spring container infrastructure components used by Spring Data GemFire
to enable GemFire to function properly inside a Spring context.
|
protected void |
configureOther(AnnotationMetadata importMetadata)
Callback method to configure other, specific GemFire cache configuration settings.
|
protected void |
configurePdx(AnnotationMetadata importMetadata)
Configures GemFire's PDX Serialization components.
|
protected <T extends CacheFactoryBean> |
constructCacheFactoryBean()
Constructs a new, initialized instance of the
CacheFactoryBean based on the Spring application's
GemFire cache type (i.e. client or peer) preference specified via annotation. |
protected boolean |
copyOnRead() |
protected Float |
criticalHeapPercentage() |
protected CacheFactoryBean.DynamicRegionSupport |
dynamicRegionSupport() |
protected Float |
evictionHeapPercentage() |
protected com.gemstone.gemfire.cache.util.GatewayConflictResolver |
gatewayConflictResolver() |
protected Properties |
gemfireProperties()
Returns a
Properties object containing GemFire System properties used to configure the GemFire cache. |
protected abstract Class |
getAnnotationType()
Returns the GemFire cache application
Annotation type pertaining to
this configuration. |
protected String |
getAnnotationTypeName()
Returns the fully-qualified class name of the GemFire cache application
Annotation
type. |
protected String |
getAnnotationTypeSimpleName()
Returns the simple class name of the GemFire cache application
Annotation type. |
protected static boolean |
hasValue(Number value)
Determines whether the given
Number has value. |
protected static boolean |
hasValue(Object value)
Determines whether the given
Object has value. |
protected static boolean |
hasValue(String value)
Determines whether the given
String has value. |
protected boolean |
isCacheServerApplication(AnnotationMetadata importMetadata)
Determines whether this is a GemFire
CacheServer application,
which is indicated by the presence of the CacheServerApplication annotation on a Spring application
@Configuration class. |
protected boolean |
isCacheServerOrPeerCacheApplication(AnnotationMetadata importMetadata)
Determines whether this is a GemFire
CacheServer or
peer cache application, which is indicated by the presence
of either the CacheServerApplication annotation or the PeerCacheApplication annotation
on a Spring application @Configuration class. |
protected boolean |
isClientCacheApplication(AnnotationMetadata importMetadata)
Determines whether this is a GemFire
ClientCache application,
which is indicated by the presence of the ClientCacheApplication annotation on a Spring application
@Configuration class. |
protected boolean |
isClientPeerOrServerCacheApplication(AnnotationMetadata importMetadata)
Determine whether this Spring application is a
CacheServer,
ClientCache or a Cache application. |
protected boolean |
isPeerCacheApplication(AnnotationMetadata importMetadata)
Determines whether this is a GemFire peer
Cache application,
which is indicated by the presence of the PeerCacheApplication annotation on a Spring application
@Configuration class. |
protected boolean |
isTypedCacheApplication(Class<? extends Annotation> annotationType,
AnnotationMetadata importMetadata)
Determines whether this Spring application is annotated with the given GemFire cache type annotation.
|
protected List<CacheFactoryBean.JndiDataSource> |
jndiDataSources() |
protected String |
locators() |
protected String |
logLevel() |
protected GemfireMappingContext |
mappingContext() |
protected Integer |
mcastPort() |
protected String |
name() |
protected abstract <T extends CacheFactoryBean> |
newCacheFactoryBean()
Constructs a new, uninitialized instance of the
CacheFactoryBean based on the Spring application's
GemFire cache type (i.e. client or peer) preference specified via annotation. |
protected <T extends com.gemstone.gemfire.pdx.PdxSerializer> |
newPdxSerializer() |
protected String |
pdxDiskStoreName() |
protected Boolean |
pdxIgnoreUnreadFields() |
protected Boolean |
pdxPersistent() |
protected Boolean |
pdxReadSerialized() |
protected com.gemstone.gemfire.pdx.PdxSerializer |
pdxSerializer() |
protected AbstractBeanDefinition |
register(AbstractBeanDefinition beanDefinition)
Registers the given
BeanDefinition with the BeanDefinitionRegistry using a generated bean name. |
protected void |
registerCustomEditorBeanFactoryPostProcessor(AnnotationMetadata importMetadata) |
protected void |
registerDefinedIndexesApplicationListener(AnnotationMetadata importMetadata) |
protected void |
registerDiskStoreDirectoryBeanPostProcessor(AnnotationMetadata importMetadata) |
protected void |
registerPdxDiskStoreAwareBeanFactoryPostProcessor(AnnotationMetadata importMetadata) |
protected com.gemstone.gemfire.pdx.PdxSerializer |
resolvePdxSerializer(String pdxSerializerBeanName) |
void |
setBeanClassLoader(ClassLoader beanClassLoader) |
void |
setBeanFactory(BeanFactory beanFactory) |
protected <T extends CacheFactoryBean> |
setCommonCacheConfiguration(T gemfireCache)
Configures common GemFire cache configuration settings.
|
void |
setImportMetadata(AnnotationMetadata importMetadata) |
protected String |
startLocator() |
String |
toString() |
protected List<com.gemstone.gemfire.cache.TransactionListener> |
transactionListeners() |
protected com.gemstone.gemfire.cache.TransactionWriter |
transactionWriter() |
protected boolean |
useBeanFactoryLocator() |
protected static final boolean DEFAULT_CLOSE
protected static final boolean DEFAULT_COPY_ON_READ
protected static final boolean DEFAULT_USE_BEAN_FACTORY_LOCATOR
protected static final int DEFAULT_MCAST_PORT
protected static final String DEFAULT_LOCATORS
protected static final String DEFAULT_LOG_LEVEL
protected static final String DEFAULT_NAME
protected static boolean hasValue(Object value)
protected static boolean hasValue(Number value)
protected static boolean hasValue(String value)
@Bean protected Properties gemfireProperties()
Properties object containing GemFire System properties used to configure the GemFire cache.
The name of the GemFire member/node in the cluster is set to a default, pre-defined, descriptive value
depending on the type of configuration meta-data applied.
Both 'mcast-port' and 'locators' are to set 0 and empty String respectively, which is necessary
for cache client-based applications. These values
can be changed for peer cache and cache server applications.
Finally, GemFire's log-level System property defaults to config.Properties object containing GemFire System properties used to configure the GemFire cache.Properties,
name(),
logLevel(),
locators()public void setBeanClassLoader(ClassLoader beanClassLoader)
setBeanClassLoader in interface BeanClassLoaderAwareprotected ClassLoader beanClassLoader()
ClassLoader use by the Spring BeanFactory to load classes
for bean definitions.ClassLoader used by the Spring BeanFactory to load classes for bean definitions.setBeanClassLoader(ClassLoader)public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory in interface BeanFactoryAwareBeansExceptionprotected BeanFactory beanFactory()
BeanFactory in the current application context.BeanFactory.IllegalStateException - if the Spring BeanFactory was not properly initialized.BeanFactorypublic void setImportMetadata(AnnotationMetadata importMetadata)
setImportMetadata in interface ImportAwareprotected void configureInfrastructure(AnnotationMetadata importMetadata)
importMetadata - AnnotationMetadata containing annotation meta-data
for the Spring GemFire cache application class.AnnotationMetadataprotected void configureCache(AnnotationMetadata importMetadata)
importMetadata - AnnotationMetadata containing the cache meta-data used to configure
the GemFire cache.AnnotationMetadataprotected void configurePdx(AnnotationMetadata importMetadata)
importMetadata - AnnotationMetadata containing PDX meta-data used to configure
the GemFire cache with PDX de/serialization capabilities.AnnotationMetadata,
GemFire PDX Serializationprotected void configureOther(AnnotationMetadata importMetadata)
importMetadata - AnnotationMetadata containing meta-data used to configure
the GemFire cache.AnnotationMetadataprotected com.gemstone.gemfire.pdx.PdxSerializer resolvePdxSerializer(String pdxSerializerBeanName)
protected <T extends com.gemstone.gemfire.pdx.PdxSerializer> T newPdxSerializer()
protected void registerCustomEditorBeanFactoryPostProcessor(AnnotationMetadata importMetadata)
protected void registerDefinedIndexesApplicationListener(AnnotationMetadata importMetadata)
protected void registerDiskStoreDirectoryBeanPostProcessor(AnnotationMetadata importMetadata)
protected void registerPdxDiskStoreAwareBeanFactoryPostProcessor(AnnotationMetadata importMetadata)
protected AbstractBeanDefinition register(AbstractBeanDefinition beanDefinition)
BeanDefinition with the BeanDefinitionRegistry using a generated bean name.beanDefinition - AbstractBeanDefinition to register.BeanDefinition.AbstractBeanDefinition,
BeanDefinitionRegistry,
#registerWithGeneratedName(AbstractBeanDefinition, BeanDefinitionRegistry),
beanFactory()protected abstract Class getAnnotationType()
Annotation type pertaining to
this configuration.Annotation type used by this application.CacheServerApplication,
ClientCacheApplication,
PeerCacheApplicationprotected String getAnnotationTypeName()
Annotation
type.Annotation
type.Class.getName(),
getAnnotationType()protected String getAnnotationTypeSimpleName()
Annotation type.Annotation type.Class.getSimpleName(),
getAnnotationType()protected boolean isCacheServerApplication(AnnotationMetadata importMetadata)
CacheServer application,
which is indicated by the presence of the CacheServerApplication annotation on a Spring application
@Configuration class.importMetadata - AnnotationMetadata containing application configuration meta-data
from the annotations used to configure the Spring application.CacheServerApplication,
isTypedCacheApplication(Class, AnnotationMetadata)protected boolean isClientCacheApplication(AnnotationMetadata importMetadata)
ClientCache application,
which is indicated by the presence of the ClientCacheApplication annotation on a Spring application
@Configuration class.importMetadata - AnnotationMetadata containing application configuration meta-data
from the annotations used to configure the Spring application.ClientCacheApplication,
isTypedCacheApplication(Class, AnnotationMetadata)protected boolean isPeerCacheApplication(AnnotationMetadata importMetadata)
Cache application,
which is indicated by the presence of the PeerCacheApplication annotation on a Spring application
@Configuration class.importMetadata - AnnotationMetadata containing application configuration meta-data
from the annotations used to configure the Spring application.PeerCacheApplication,
isTypedCacheApplication(Class, AnnotationMetadata)protected boolean isTypedCacheApplication(Class<? extends Annotation> annotationType, AnnotationMetadata importMetadata)
annotationType - Annotation cache type.importMetadata - AnnotationMetadata containing application configuration meta-data
from the annotations used to configure the Spring application.AnnotationMetadata,
Annotation,
getAnnotationTypeName(),
getAnnotationType()protected boolean isCacheServerOrPeerCacheApplication(AnnotationMetadata importMetadata)
CacheServer or
peer cache application, which is indicated by the presence
of either the CacheServerApplication annotation or the PeerCacheApplication annotation
on a Spring application @Configuration class.importMetadata - AnnotationMetadata containing application configuration meta-data
from the annotations used to configure the Spring application.AnnotationMetadata,
CacheServerApplication,
PeerCacheApplication,
isCacheServerApplication(AnnotationMetadata),
isPeerCacheApplication(AnnotationMetadata)protected boolean isClientPeerOrServerCacheApplication(AnnotationMetadata importMetadata)
CacheServer,
ClientCache or a Cache application.importMetadata - AnnotationMetadata containing application configuration meta-data
from the class type-level annotations used to configure the Spring application.isCacheServerApplication(AnnotationMetadata),
isClientCacheApplication(AnnotationMetadata),
isPeerCacheApplication(AnnotationMetadata)protected <T extends CacheFactoryBean> T constructCacheFactoryBean()
CacheFactoryBean based on the Spring application's
GemFire cache type (i.e. client or peer) preference specified via annotation.T - Class type of the CacheFactoryBean.CacheFactoryBean given the Spring application's
GemFire cache type preference (i.e client or peer) specified with the corresponding annotation
(e.g. ClientCacheApplication or PeerCacheApplication);ClientCacheFactoryBean,
CacheFactoryBean,
setCommonCacheConfiguration(CacheFactoryBean),
newCacheFactoryBean()protected abstract <T extends CacheFactoryBean> T newCacheFactoryBean()
CacheFactoryBean based on the Spring application's
GemFire cache type (i.e. client or peer) preference specified via annotation.T - Class type of the CacheFactoryBean.CacheFactoryBean given the Spring application's
GemFire cache type preference (i.e client or peer) specified with the corresponding annotation
(e.g. ClientCacheApplication or PeerCacheApplication).ClientCacheFactoryBean,
CacheFactoryBeanprotected <T extends CacheFactoryBean> T setCommonCacheConfiguration(T gemfireCache)
T - Class type of the CacheFactoryBean.gemfireCache - CacheFactoryBean instance to configure.CacheFactoryBean after common configuration settings have been applied.ClientCacheFactoryBean,
CacheFactoryBeanprotected Resource cacheXml()
protected boolean close()
protected boolean copyOnRead()
protected Float criticalHeapPercentage()
protected CacheFactoryBean.DynamicRegionSupport dynamicRegionSupport()
protected Float evictionHeapPercentage()
protected com.gemstone.gemfire.cache.util.GatewayConflictResolver gatewayConflictResolver()
protected List<CacheFactoryBean.JndiDataSource> jndiDataSources()
protected String locators()
protected String logLevel()
protected GemfireMappingContext mappingContext()
protected Integer mcastPort()
protected String name()
protected String pdxDiskStoreName()
protected Boolean pdxIgnoreUnreadFields()
protected Boolean pdxPersistent()
protected Boolean pdxReadSerialized()
protected com.gemstone.gemfire.pdx.PdxSerializer pdxSerializer()
protected String startLocator()
protected List<com.gemstone.gemfire.cache.TransactionListener> transactionListeners()
protected com.gemstone.gemfire.cache.TransactionWriter transactionWriter()
protected boolean useBeanFactoryLocator()
public void add(Properties gemfireProperties)
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.