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:
-
AnnotationPropertiesCacheGemFireCacheClientCacheCacheServerBeanFactoryBeanDefinitionBeanDefinitionBuilderBeanDefinitionRegistryBeanConfigurationImportAwareAnnotationAttributesResourceAnnotationMetadataCacheFactoryBeanClientCacheFactoryBeanAbstractAnnotationConfigSupportCustomEditorBeanFactoryPostProcessorDefinedIndexesApplicationListenerDiskStoreDirectoryBeanPostProcessorPropertiesBuilder
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport
AbstractAnnotationConfigSupport.TypeResolver<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final booleanprotected static final booleanprotected static final Stringprotected static final Stringprotected static final intprotected static final Stringprotected static final booleanFields inherited from class org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport
INFRASTRUCTURE_ROLES, ORG_SPRINGFRAMEWORK_DATA_GEMFIRE_PACKAGE, ORG_SPRINGFRAMEWORK_PACKAGE, SPRING_DATA_GEMFIRE_PROPERTY_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Properties gemfireProperties) protected voidconfigureCache(AnnotationMetadata importMetadata) Configures Pivotal GemFire/Apache Geode cache specific settings.protected <T extends CacheFactoryBean>
TconfigureCacheFactoryBean(T gemfireCache) Configures theCacheFactoryBeanwith common cache configuration settings.protected voidconfigureInfrastructure(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 voidconfigureOptional(AnnotationMetadata importMetadata) Callback method allowing developers to configure other cache or application specific configuration settings.protected <T extends CacheFactoryBean>
TConstructs a new, initialized instance ofCacheFactoryBeanbased on the Spring application's cache type preference (i.e. client or peer), which is expressed via the appropriate annotation.protected PropertiesReturns aPropertiesobject containing Pivotal GemFire/Apache Geode properties used to configure the Pivotal GemFire/Apache Geode cache.protected Resourceprotected booleanprotected Floatprotected Floatprotected Floatprotected Floatprotected GatewayConflictResolverprotected List<CacheFactoryBean.JndiDataSource>protected List<TransactionListener>protected TransactionWriterprotected booleanisCacheServerApplication(AnnotationMetadata importMetadata) Determines whether this is a GemFireCacheServerapplication, which is indicated by the presence of theCacheServerApplicationannotation on a Spring application@Configurationclass.protected booleanisCacheServerOrPeerCacheApplication(AnnotationMetadata importMetadata) Determines whether this is a GemFireCacheServerorpeer cacheapplication, which is indicated by the presence of either theCacheServerApplicationannotation or thePeerCacheApplicationannotation on a Spring application@Configurationclass.protected booleanisClientCacheApplication(AnnotationMetadata importMetadata) Determines whether this is a GemFireClientCacheapplication, which is indicated by the presence of theClientCacheApplicationannotation on a Spring application@Configurationclass.protected booleanisClientPeerOrServerCacheApplication(AnnotationMetadata importMetadata) protected booleanisClose()protected booleanisPeerCacheApplication(AnnotationMetadata importMetadata) Determines whether this is a GemFire peerCacheapplication, which is indicated by the presence of thePeerCacheApplicationannotation on a Spring application@Configurationclass.protected booleanisTypedCacheApplication(Class<? extends Annotation> annotationType, AnnotationMetadata importMetadata) Determines whether this Spring application is annotated with the given GemFire cache type annotation.protected Stringlocators()protected StringlogLevel()protected Integerprotected Stringname()protected abstract <T extends CacheFactoryBean>
TConstructs a new, uninitialized instance ofCacheFactoryBeanbased on the Spring application's cache type preference (i.e. client or peer), which is expressed via the appropriate annotation.voidsetImportMetadata(AnnotationMetadata importMetadata) protected StringtoString()protected booleanMethods 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, 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
-
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 aPropertiesobject 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 cacheandcache serverapplications. Finally, the log-level property defaults to config.- Returns:
- a
Propertiesobject containing Pivotal GemFire/Apache Geode properties used to configure the Pivotal GemFire/Apache Geode cache instance. - See Also:
-
setImportMetadata
- Specified by:
setImportMetadatain 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-AnnotationMetadatacontaining annotation meta-data for the Spring Data GemFire cache application class.- See Also:
-
configureCache
Configures Pivotal GemFire/Apache Geode cache specific settings.- Parameters:
importMetadata-AnnotationMetadatacontaining 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-AnnotationMetadatacontaining meta-data used to configure the cache or application.- See Also:
-
constructCacheFactoryBean
Constructs a new, initialized instance ofCacheFactoryBeanbased on the Spring application's cache type preference (i.e. client or peer), which is expressed via the appropriate annotation. Use theClientCacheApplicationAnnotation to construct acache clientapplication. Use thePeerCacheApplicationAnnotation to construct apeer cacheapplication.- Type Parameters:
T-Classspecific sub-type of theCacheFactoryBean.- Returns:
- a new instance of the appropriate
CacheFactoryBeangiven the Spring application's cache type preference (i.e client or peer), (e.g.ClientCacheApplicationorPeerCacheApplication). - See Also:
-
newCacheFactoryBean
Constructs a new, uninitialized instance ofCacheFactoryBeanbased on the Spring application's cache type preference (i.e. client or peer), which is expressed via the appropriate annotation. Use theClientCacheApplicationAnnotation to construct acache clientapplication. Use thePeerCacheApplicationAnnotation to construct apeer cacheapplication.- Type Parameters:
T-Classspecific sub-type of theCacheFactoryBean.- Returns:
- a new instance of the appropriate
CacheFactoryBeangiven the Spring application's cache type preference (i.e client or peer), (e.g.ClientCacheApplicationorPeerCacheApplication). - See Also:
-
configureCacheFactoryBean
Configures theCacheFactoryBeanwith common cache configuration settings.- Type Parameters:
T-Classspecific sub-type of theCacheFactoryBean.- Parameters:
gemfireCache-CacheFactoryBeanto configure.- Returns:
- the given
CacheFactoryBeanwith common cache configuration settings applied. - See Also:
-
isCacheServerApplication
Determines whether this is a GemFireCacheServerapplication, which is indicated by the presence of theCacheServerApplicationannotation on a Spring application@Configurationclass.- Parameters:
importMetadata-AnnotationMetadatacontaining 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 GemFireClientCacheapplication, which is indicated by the presence of theClientCacheApplicationannotation on a Spring application@Configurationclass.- Parameters:
importMetadata-AnnotationMetadatacontaining 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 peerCacheapplication, which is indicated by the presence of thePeerCacheApplicationannotation on a Spring application@Configurationclass.- Parameters:
importMetadata-AnnotationMetadatacontaining 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-Annotationcache type.importMetadata-AnnotationMetadatacontaining 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 GemFireCacheServerorpeer cacheapplication, which is indicated by the presence of either theCacheServerApplicationannotation or thePeerCacheApplicationannotation on a Spring application@Configurationclass.- Parameters:
importMetadata-AnnotationMetadatacontaining 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-AnnotationMetadatacontaining 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
-