@Configuration public abstract class AbstractCacheConfiguration extends AbstractAnnotationConfigSupport implements 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 Pivotal GemFire/Apache Geode
peer caches
and client caches
.Annotation
,
Properties
,
Cache
,
GemFireCache
,
ClientCache
,
CacheServer
,
BeanFactory
,
BeanDefinition
,
BeanDefinitionBuilder
,
BeanDefinitionRegistry
,
Bean
,
Configuration
,
ImportAware
,
AnnotationAttributes
,
Resource
,
AnnotationMetadata
,
CacheFactoryBean
,
ClientCacheFactoryBean
,
AbstractAnnotationConfigSupport
,
CustomEditorBeanFactoryPostProcessor
,
DefinedIndexesApplicationListener
,
DiskStoreDirectoryBeanPostProcessor
AbstractAnnotationConfigSupport.TypeResolver<T>
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 |
INFRASTRUCTURE_ROLES, ORG_SPRINGFRAMEWORK_DATA_GEMFIRE_PACKAGE, ORG_SPRINGFRAMEWORK_PACKAGE, SPRING_DATA_GEMFIRE_PROPERTY_PREFIX
Constructor and Description |
---|
AbstractCacheConfiguration() |
Modifier and Type | Method and Description |
---|---|
void |
add(Properties gemfireProperties) |
protected void |
configureCache(AnnotationMetadata importMetadata)
Configures Pivotal GemFire/Apache Geode cache specific settings.
|
protected <T extends CacheFactoryBean> |
configureCacheFactoryBean(T gemfireCache)
Configures the
CacheFactoryBean with common cache configuration settings. |
protected void |
configureInfrastructure(AnnotationMetadata importMetadata)
Configures Spring container infrastructure components and beans used by SDG to enable Pivotal GemFire
or Apache Geode to function properly inside a Spring context.
|
protected void |
configureOptional(AnnotationMetadata importMetadata)
=======
>>>>>>> 09d8cc7...
|
protected <T extends CacheFactoryBean> |
constructCacheFactoryBean()
Constructs a new, initialized instance of
CacheFactoryBean based on the Spring application's
cache type preference (i.e. client or peer), which is expressed via the appropriate annotation. |
protected Properties |
gemfireProperties()
Returns a
Properties object containing Pivotal GemFire/Apache Geode properties used to configure
the Pivotal GemFire/Apache Geode cache. |
protected Resource |
getCacheXml() |
protected boolean |
getCopyOnRead() |
protected Float |
getCriticalHeapPercentage() |
protected Float |
getCriticalOffHeapPercentage() |
protected CacheFactoryBean.DynamicRegionSupport |
getDynamicRegionSupport() |
protected Float |
getEvictionHeapPercentage() |
protected Float |
getEvictionOffHeapPercentage() |
protected org.apache.geode.cache.util.GatewayConflictResolver |
getGatewayConflictResolver() |
protected List<CacheFactoryBean.JndiDataSource> |
getJndiDataSources() |
protected List<org.apache.geode.cache.TransactionListener> |
getTransactionListeners() |
protected org.apache.geode.cache.TransactionWriter |
getTransactionWriter() |
protected boolean |
isCacheServerApplication(AnnotationMetadata importMetadata)
Determines whether this is a Pivotal 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 Pivotal 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 Pivotal 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 |
isClose() |
protected boolean |
isPeerCacheApplication(AnnotationMetadata importMetadata)
Determines whether this is a Pivotal 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 Pivotal GemFire cache type annotation.
|
protected String |
locators() |
protected String |
logLevel() |
protected Integer |
mcastPort() |
protected String |
name() |
protected abstract <T extends CacheFactoryBean> |
newCacheFactoryBean()
Constructs a new, uninitialized instance of
CacheFactoryBean based on the Spring application's
cache type preference (i.e. client or peer), which is expressed via the appropriate annotation. |
void |
setImportMetadata(AnnotationMetadata importMetadata) |
protected String |
startLocator() |
String |
toString() |
protected boolean |
useBeanFactoryLocator() |
arrayOfPropertyNamesFor, arrayOfPropertyNamesFor, asArrayProperty, cacheClientProperty, cacheCompressionProperty, cacheOffHeapProperty, cachePeerProperty, cacheProperty, cacheServerProperty, clusterProperty, diskStoreProperty, entitiesProperty, gatewayReceiverProperty, gatewaySenderProperty, getAnnotationAttributes, getAnnotationAttributes, getAnnotationAttributes, getAnnotationType, getAnnotationTypeName, getAnnotationTypeSimpleName, getBeanClassLoader, getBeanFactory, getEnvironment, getEvaluationContext, getLog, hasValue, hasValue, hasValue, httpServiceProperty, isAnnotationPresent, isAnnotationPresent, isNotInfrastructureBean, isNotInfrastructureBean, isNotInfrastructureClass, isNotInfrastructureClass, isNotInfrastructureRole, isUserLevelMethod, locatorProperty, logDebug, logDebug, logError, logError, loggingProperty, logInfo, logInfo, logWarning, logWarning, managementProperty, managerProperty, memcachedServiceProperty, namedCacheServerProperty, namedDiskStoreProperty, namedGatewaySenderProperty, namedPoolProperty, newEvaluationContext, newLog, pdxProperty, poolProperty, propertyName, redisServiceProperty, register, register, requireProperty, resolveAnnotation, resolveBeanClass, resolveBeanClass, resolveBeanClass, resolveBeanClassLoader, resolveBeanClassLoader, resolveBeanClassName, resolveProperty, resolveProperty, resolveProperty, resolveProperty, resolveProperty, resolveProperty, resolveProperty, resolveProperty, safeResolveType, securityProperty, serviceProperty, setBeanClassLoader, setBeanFactory, setEnvironment, sslProperty, statsProperty
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
@Bean protected Properties gemfireProperties()
Properties
object containing Pivotal GemFire/Apache Geode properties used to configure
the Pivotal GemFire/Apache Geode cache.
The name of the Pivotal GemFire/Apache Geode member/node in the cluster is set to a default,
pre-defined and descriptive value depending on the type of configuration meta-data applied.
mcast-port is set to 0 and locators is set to an empty String
,
which is necessary for cache client
-based applications. These values can be changed
and set accoridingly for peer cache
and cache server
applications.
Finally, the log-level property defaults to config.Properties
object containing Pivotal GemFire/Apache Geode properties used to configure
the Pivotal GemFire/Apache Geode cache instance.Properties
,
locators()
,
logLevel()
,
mcastPort()
,
name()
public void setImportMetadata(AnnotationMetadata importMetadata)
setImportMetadata
in interface ImportAware
protected void configureInfrastructure(AnnotationMetadata importMetadata)
importMetadata
- AnnotationMetadata
containing annotation meta-data
for the SDG cache application class.AnnotationMetadata
protected void configureCache(AnnotationMetadata importMetadata)
importMetadata
- AnnotationMetadata
containing the cache meta-data used to configure the cache.AnnotationMetadata
protected void configureOptional(AnnotationMetadata importMetadata)
importMetadata
- AnnotationMetadata
containing meta-data used to configure the cache or application.AnnotationMetadata
protected <T extends CacheFactoryBean> T constructCacheFactoryBean()
CacheFactoryBean
based on the Spring application's
cache type preference (i.e. client or peer), which is expressed via the appropriate annotation.
Use the ClientCacheApplication
Annotation to construct a cache client
application.
Use the PeerCacheApplication
Annotation to construct a peer cache
application.T
- Class
specific sub-type of the CacheFactoryBean
.CacheFactoryBean
given the Spring application's
cache type preference (i.e client or peer), (e.g. ClientCacheApplication
or PeerCacheApplication
).ClientCacheFactoryBean
,
CacheFactoryBean
,
configureCacheFactoryBean(CacheFactoryBean)
,
newCacheFactoryBean()
protected abstract <T extends CacheFactoryBean> T newCacheFactoryBean()
CacheFactoryBean
based on the Spring application's
cache type preference (i.e. client or peer), which is expressed via the appropriate annotation.
Use the ClientCacheApplication
Annotation to construct a cache client
application.
Use the PeerCacheApplication
Annotation to construct a peer cache
application.T
- Class
specific sub-type of the CacheFactoryBean
.CacheFactoryBean
given the Spring application's
cache type preference (i.e client or peer), (e.g. ClientCacheApplication
or PeerCacheApplication
).ClientCacheFactoryBean
,
CacheFactoryBean
protected <T extends CacheFactoryBean> T configureCacheFactoryBean(T gemfireCache)
CacheFactoryBean
with common cache configuration settings.T
- Class
specific sub-type of the CacheFactoryBean
.gemfireCache
- CacheFactoryBean
to configure.CacheFactoryBean
with common cache configuration settings applied.ClientCacheFactoryBean
,
CacheFactoryBean
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
,
AbstractAnnotationConfigSupport.getAnnotationTypeName()
,
AbstractAnnotationConfigSupport.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 Resource getCacheXml()
protected boolean isClose()
protected boolean getCopyOnRead()
protected Float getCriticalHeapPercentage()
protected Float getCriticalOffHeapPercentage()
protected CacheFactoryBean.DynamicRegionSupport getDynamicRegionSupport()
protected Float getEvictionHeapPercentage()
protected Float getEvictionOffHeapPercentage()
protected org.apache.geode.cache.util.GatewayConflictResolver getGatewayConflictResolver()
protected List<CacheFactoryBean.JndiDataSource> getJndiDataSources()
protected String locators()
protected String logLevel()
protected Integer mcastPort()
protected String name()
protected String startLocator()
protected List<org.apache.geode.cache.TransactionListener> getTransactionListeners()
protected org.apache.geode.cache.TransactionWriter getTransactionWriter()
protected boolean useBeanFactoryLocator()
public void add(Properties gemfireProperties)
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.