Class AbstractCacheConfiguration
java.lang.Object
org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport
org.springframework.data.gemfire.config.annotation.AbstractCacheConfiguration
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,ImportAware
,EnvironmentAware
- Direct Known Subclasses:
ClientCacheConfiguration
,PeerCacheConfiguration
@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
.- Since:
- 1.9.0
- Author:
- John Blum
- 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
(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
(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
(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. client or peer), which is expressed via the appropriate annotation.protected Properties
Returns aProperties
object containing Pivotal GemFire/Apache Geode properties used to configure the Pivotal GemFire/Apache Geode cache.protected Resource
protected boolean
protected Float
protected Float
protected Float
protected Float
protected GatewayConflictResolver
protected List<CacheFactoryBean.JndiDataSource>
protected List<TransactionListener>
protected TransactionWriter
protected boolean
isCacheServerApplication
(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
(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
(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
(AnnotationMetadata importMetadata) protected boolean
isClose()
protected boolean
isPeerCacheApplication
(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, 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. client or peer), which is expressed via the appropriate annotation.void
setImportMetadata
(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
- Specified by:
setImportMetadata
in interfaceImportAware
-
configureInfrastructure
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:
-
configureCache
Configures Pivotal GemFire/Apache Geode cache specific settings.- Parameters:
importMetadata
-AnnotationMetadata
containing the cache meta-data used to configure the cache.- See Also:
-
configureOptional
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:
-
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
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
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
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, 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
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
- 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
-
isClose
protected boolean isClose() -
getCopyOnRead
protected boolean getCopyOnRead() -
getCriticalHeapPercentage
-
getCriticalOffHeapPercentage
-
getEvictionHeapPercentage
-
getEvictionOffHeapPercentage
-
getGatewayConflictResolver
-
getJndiDataSources
-
locators
-
logLevel
-
mcastPort
-
name
-
startLocator
-
getTransactionListeners
-
getTransactionWriter
-
useBeanFactoryLocator
protected boolean useBeanFactoryLocator() -
add
-
toString
-