Class AbstractCacheConfiguration
java.lang.Object
org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport
org.springframework.data.gemfire.config.annotation.AbstractCacheConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.context.annotation.ImportAware
,org.springframework.context.EnvironmentAware
- Direct Known Subclasses:
ClientCacheConfiguration
,PeerCacheConfiguration
@Configuration
public abstract class AbstractCacheConfiguration
extends AbstractAnnotationConfigSupport
implements org.springframework.context.annotation.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
.- Since:
- 1.9.0
- See Also:
-
Annotation
Properties
Cache
GemFireCache
ClientCache
CacheServer
BeanFactory
BeanDefinition
BeanDefinitionBuilder
BeanDefinitionRegistry
Bean
Configuration
ImportAware
AnnotationAttributes
Resource
AnnotationMetadata
CacheFactoryBean
ClientCacheFactoryBean
AbstractAnnotationConfigSupport
CustomEditorBeanFactoryPostProcessor
DefinedIndexesApplicationListener
DiskStoreDirectoryBeanPostProcessor
PropertiesBuilder
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport
AbstractAnnotationConfigSupport.TypeResolver<T>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final boolean
protected static final boolean
protected static final String
protected static final String
protected static final int
protected static final String
protected static final boolean
Fields inherited from class org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport
CURRENT_THREAD_CONTEXT_CLASS_LOADER, INFRASTRUCTURE_ROLES, ORG_SPRINGFRAMEWORK_DATA_GEMFIRE_PACKAGE, ORG_SPRINGFRAMEWORK_PACKAGE, SPRING_DATA_GEMFIRE_PROPERTY_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(Properties gemfireProperties) protected void
configureCache
(org.springframework.core.type.AnnotationMetadata importMetadata) Configures Pivotal GemFire/Apache Geode cache specific settings.protected <T extends CacheFactoryBean>
TconfigureCacheFactoryBean
(T gemfireCache) Configures theCacheFactoryBean
with common cache configuration settings.protected void
configureInfrastructure
(org.springframework.core.type.AnnotationMetadata importMetadata) Configures Spring container infrastructure components and beans used by Spring Data GemFire to enable Pivotal GemFire or Apache Geode to function properly inside a Spring context.protected void
configureOptional
(org.springframework.core.type.AnnotationMetadata importMetadata) Callback method allowing developers to configure other cache or application specific configuration settings.protected <T extends CacheFactoryBean>
TConstructs a new, initialized instance ofCacheFactoryBean
based on the Spring application's cache type preference (i.e.protected Properties
Returns aProperties
object containing Pivotal GemFire/Apache Geode properties used to configure the Pivotal GemFire/Apache Geode cache.protected org.springframework.core.io.Resource
protected boolean
protected Float
protected Float
protected Float
protected Float
protected org.apache.geode.cache.util.GatewayConflictResolver
protected List<CacheFactoryBean.JndiDataSource>
protected List<org.apache.geode.cache.TransactionListener>
protected org.apache.geode.cache.TransactionWriter
protected boolean
isCacheServerApplication
(org.springframework.core.type.AnnotationMetadata importMetadata) Determines whether this is a GemFireCacheServer
application, which is indicated by the presence of theCacheServerApplication
annotation on a Spring application@Configuration
class.protected boolean
isCacheServerOrPeerCacheApplication
(org.springframework.core.type.AnnotationMetadata importMetadata) Determines whether this is a GemFireCacheServer
orpeer cache
application, which is indicated by the presence of either theCacheServerApplication
annotation or thePeerCacheApplication
annotation on a Spring application@Configuration
class.protected boolean
isClientCacheApplication
(org.springframework.core.type.AnnotationMetadata importMetadata) Determines whether this is a GemFireClientCache
application, which is indicated by the presence of theClientCacheApplication
annotation on a Spring application@Configuration
class.protected boolean
isClientPeerOrServerCacheApplication
(org.springframework.core.type.AnnotationMetadata importMetadata) Determine whether this Spring application is aCacheServer
,ClientCache
or aCache
application.protected boolean
isClose()
protected boolean
isPeerCacheApplication
(org.springframework.core.type.AnnotationMetadata importMetadata) Determines whether this is a GemFire peerCache
application, which is indicated by the presence of thePeerCacheApplication
annotation on a Spring application@Configuration
class.protected boolean
isTypedCacheApplication
(Class<? extends Annotation> annotationType, org.springframework.core.type.AnnotationMetadata importMetadata) Determines whether this Spring application is annotated with the given GemFire cache type annotation.protected String
locators()
protected String
logLevel()
protected Integer
protected String
name()
protected abstract <T extends CacheFactoryBean>
TConstructs a new, uninitialized instance ofCacheFactoryBean
based on the Spring application's cache type preference (i.e.void
setImportMetadata
(org.springframework.core.type.AnnotationMetadata importMetadata) protected String
toString()
protected boolean
Methods inherited from class org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport
arrayOfPropertyNamesFor, arrayOfPropertyNamesFor, asArrayProperty, cacheClientProperty, cacheCompressionProperty, cacheOffHeapProperty, cachePeerProperty, cacheProperty, cacheServerProperty, clusterProperty, diskStoreProperty, entitiesProperty, gatewayReceiverProperty, gatewaySenderProperty, getAnnotationAttributes, getAnnotationAttributes, getAnnotationAttributes, getAnnotationType, getAnnotationTypeName, getAnnotationTypeSimpleName, getBeanClassLoader, getBeanFactory, getEnvironment, getEvaluationContext, getLogger, hasValue, hasValue, hasValue, httpServiceProperty, isAnnotationPresent, isAnnotationPresent, isNotInfrastructureBean, isNotInfrastructureBean, isNotInfrastructureClass, isNotInfrastructureRole, isUserLevelMethod, locatorProperty, logDebug, logDebug, logError, logError, loggingProperty, logInfo, logInfo, logWarning, logWarning, managementProperty, managerProperty, memcachedServiceProperty, namedCacheServerProperty, namedDiskStoreProperty, namedGatewaySenderProperty, namedPoolProperty, newEvaluationContext, newLogger, pdxProperty, poolProperty, propertyName, register, register, requireProperty, resolveAnnotation, resolveBeanClass, resolveBeanClass, resolveBeanClass, resolveBeanClassLoader, resolveBeanClassLoader, resolveBeanClassLoader, resolveBeanClassName, resolveProperty, resolveProperty, resolveProperty, resolveProperty, resolveProperty, resolveProperty, resolveProperty, resolveProperty, safeResolveType, securityProperty, serviceProperty, setBeanClassLoader, setBeanFactory, setEnvironment, sslProperty, statsProperty
-
Field Details
-
DEFAULT_CLOSE
protected static final boolean DEFAULT_CLOSE- See Also:
-
DEFAULT_COPY_ON_READ
protected static final boolean DEFAULT_COPY_ON_READ- See Also:
-
DEFAULT_USE_BEAN_FACTORY_LOCATOR
protected static final boolean DEFAULT_USE_BEAN_FACTORY_LOCATOR- See Also:
-
DEFAULT_MCAST_PORT
protected static final int DEFAULT_MCAST_PORT- See Also:
-
DEFAULT_LOCATORS
- See Also:
-
DEFAULT_LOG_LEVEL
- See Also:
-
DEFAULT_NAME
- See Also:
-
-
Constructor Details
-
AbstractCacheConfiguration
public AbstractCacheConfiguration()
-
-
Method Details
-
gemfireProperties
Returns aProperties
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 anempty String
, which is necessary forcache client
-based applications. These values can be changed and set accordingly forpeer cache
andcache server
applications. Finally, the log-level property defaults to config.- Returns:
- a
Properties
object containing Pivotal GemFire/Apache Geode properties used to configure the Pivotal GemFire/Apache Geode cache instance. - See Also:
-
setImportMetadata
public void setImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata) - Specified by:
setImportMetadata
in interfaceorg.springframework.context.annotation.ImportAware
-
configureInfrastructure
protected void configureInfrastructure(org.springframework.core.type.AnnotationMetadata importMetadata) Configures Spring container infrastructure components and beans used by Spring Data GemFire to enable Pivotal GemFire or Apache Geode to function properly inside a Spring context.- Parameters:
importMetadata
-AnnotationMetadata
containing annotation meta-data for the Spring Data GemFire cache application class.- See Also:
-
AnnotationMetadata
-
configureCache
protected void configureCache(org.springframework.core.type.AnnotationMetadata importMetadata) Configures Pivotal GemFire/Apache Geode cache specific settings.- Parameters:
importMetadata
-AnnotationMetadata
containing the cache meta-data used to configure the cache.- See Also:
-
AnnotationMetadata
-
configureOptional
protected void configureOptional(org.springframework.core.type.AnnotationMetadata importMetadata) Callback method allowing developers to configure other cache or application specific configuration settings.- Parameters:
importMetadata
-AnnotationMetadata
containing meta-data used to configure the cache or application.- See Also:
-
AnnotationMetadata
-
constructCacheFactoryBean
Constructs a new, initialized instance ofCacheFactoryBean
based on the Spring application's cache type preference (i.e. client or peer), which is expressed via the appropriate annotation. Use theClientCacheApplication
Annotation to construct acache client
application. Use thePeerCacheApplication
Annotation to construct apeer cache
application.- Type Parameters:
T
-Class
specific sub-type of theCacheFactoryBean
.- Returns:
- a new instance of the appropriate
CacheFactoryBean
given the Spring application's cache type preference (i.e client or peer), (e.g.ClientCacheApplication
orPeerCacheApplication
). - See Also:
-
newCacheFactoryBean
Constructs a new, uninitialized instance ofCacheFactoryBean
based on the Spring application's cache type preference (i.e. client or peer), which is expressed via the appropriate annotation. Use theClientCacheApplication
Annotation to construct acache client
application. Use thePeerCacheApplication
Annotation to construct apeer cache
application.- Type Parameters:
T
-Class
specific sub-type of theCacheFactoryBean
.- Returns:
- a new instance of the appropriate
CacheFactoryBean
given the Spring application's cache type preference (i.e client or peer), (e.g.ClientCacheApplication
orPeerCacheApplication
). - See Also:
-
configureCacheFactoryBean
Configures theCacheFactoryBean
with common cache configuration settings.- Type Parameters:
T
-Class
specific sub-type of theCacheFactoryBean
.- Parameters:
gemfireCache
-CacheFactoryBean
to configure.- Returns:
- the given
CacheFactoryBean
with common cache configuration settings applied. - See Also:
-
isCacheServerApplication
protected boolean isCacheServerApplication(org.springframework.core.type.AnnotationMetadata importMetadata) Determines whether this is a GemFireCacheServer
application, which is indicated by the presence of theCacheServerApplication
annotation on a Spring application@Configuration
class.- Parameters:
importMetadata
-AnnotationMetadata
containing application configuration meta-data from the annotations used to configure the Spring application.- Returns:
- a boolean value indicating whether this is a GemFire cache server application.
- See Also:
-
isClientCacheApplication
protected boolean isClientCacheApplication(org.springframework.core.type.AnnotationMetadata importMetadata) Determines whether this is a GemFireClientCache
application, which is indicated by the presence of theClientCacheApplication
annotation on a Spring application@Configuration
class.- Parameters:
importMetadata
-AnnotationMetadata
containing application configuration meta-data from the annotations used to configure the Spring application.- Returns:
- a boolean value indicating whether this is a GemFire cache client application.
- See Also:
-
isPeerCacheApplication
protected boolean isPeerCacheApplication(org.springframework.core.type.AnnotationMetadata importMetadata) Determines whether this is a GemFire peerCache
application, which is indicated by the presence of thePeerCacheApplication
annotation on a Spring application@Configuration
class.- Parameters:
importMetadata
-AnnotationMetadata
containing application configuration meta-data from the annotations used to configure the Spring application.- Returns:
- a boolean value indicating whether this is a GemFire peer cache application.
- See Also:
-
isTypedCacheApplication
protected boolean isTypedCacheApplication(Class<? extends Annotation> annotationType, org.springframework.core.type.AnnotationMetadata importMetadata) Determines whether this Spring application is annotated with the given GemFire cache type annotation.- Parameters:
annotationType
-Annotation
cache type.importMetadata
-AnnotationMetadata
containing application configuration meta-data from the annotations used to configure the Spring application.- Returns:
- a boolean value indicating if this Spring application is annotated with the given GemFire cache type annotation.
- See Also:
-
isCacheServerOrPeerCacheApplication
protected boolean isCacheServerOrPeerCacheApplication(org.springframework.core.type.AnnotationMetadata importMetadata) Determines whether this is a GemFireCacheServer
orpeer cache
application, which is indicated by the presence of either theCacheServerApplication
annotation or thePeerCacheApplication
annotation on a Spring application@Configuration
class.- Parameters:
importMetadata
-AnnotationMetadata
containing application configuration meta-data from the annotations used to configure the Spring application.- Returns:
- a boolean value indicating whether this is a GemFire cache server or peer cache application.
- See Also:
-
isClientPeerOrServerCacheApplication
protected boolean isClientPeerOrServerCacheApplication(org.springframework.core.type.AnnotationMetadata importMetadata) Determine whether this Spring application is aCacheServer
,ClientCache
or aCache
application.- Parameters:
importMetadata
-AnnotationMetadata
containing application configuration meta-data from the class type-level annotations used to configure the Spring application.- Returns:
- a boolean value indicating whether this is a GemFire cache server, client cache or peer cache Spring application.
- See Also:
-
getCacheXml
protected org.springframework.core.io.Resource getCacheXml() -
isClose
protected boolean isClose() -
getCopyOnRead
protected boolean getCopyOnRead() -
getCriticalHeapPercentage
-
getCriticalOffHeapPercentage
-
getEvictionHeapPercentage
-
getEvictionOffHeapPercentage
-
getGatewayConflictResolver
protected org.apache.geode.cache.util.GatewayConflictResolver getGatewayConflictResolver() -
getJndiDataSources
-
locators
-
logLevel
-
mcastPort
-
name
-
startLocator
-
getTransactionListeners
-
getTransactionWriter
protected org.apache.geode.cache.TransactionWriter getTransactionWriter() -
useBeanFactoryLocator
protected boolean useBeanFactoryLocator() -
add
-
toString
-