public abstract class AbstractCacheConfiguration extends Object implements BeanFactoryAware, BeanClassLoaderAware, ImportAware
Configuration
support.
This class contain configuration settings common to both GemFire peer caches
and client caches
.BeanClassLoaderAware
,
BeanFactory
,
BeanFactoryAware
,
Bean
,
ImportAware
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEFAULT_CLOSE |
protected static boolean |
DEFAULT_COPY_ON_READ |
protected static String |
DEFAULT_LOG_LEVEL |
protected static String |
DEFAULT_NAME |
protected static boolean |
DEFAULT_USE_BEAN_FACTORY_LOCATOR |
Constructor and Description |
---|
AbstractCacheConfiguration() |
Modifier and Type | Method and Description |
---|---|
protected ClassLoader |
beanClassLoader()
Gets a reference to the
ClassLoader use by the Spring BeanFactory to load classes
for bean definitions. |
protected BeanFactory |
beanFactory()
Gets 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 |
configureOther(AnnotationMetadata importMetadata)
Callback method to configure other, specific GemFire cache configuration settings.
|
protected void |
configurePdx(AnnotationMetadata importMetadata)
Configures GemFire's PDX Serialization feature.
|
protected <T extends CacheFactoryBean> |
constructCacheFactoryBean()
Constructs a new, initialized instance of the
CacheFactoryBean based on the application
GemFire cache type (i.e. client or peer). |
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 give
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 |
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 List<CacheFactoryBean.JndiDataSource> |
jndiDataSources() |
protected String |
locators() |
protected String |
logLevel() |
protected String |
name() |
protected abstract <T extends CacheFactoryBean> |
newCacheFactoryBean()
Constructs a new, uninitialized instance of the
CacheFactoryBean based on the application
GemFire cache type (i.e. client or peer). |
protected static <T> List<T> |
nullSafeList(List<T> list)
|
protected static <T> Set<T> |
nullSafeSet(Set<T> set)
|
protected static <T> T |
nullSafeValue(T value,
T defaultValue)
Returns the given
value if not null or the defaultValue . |
protected String |
pdxDiskStoreName() |
protected Boolean |
pdxIgnoreUnreadFields() |
protected Boolean |
pdxPersistent() |
protected Boolean |
pdxReadSerialized() |
protected com.gemstone.gemfire.pdx.PdxSerializer |
pdxSerializer() |
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) |
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 String DEFAULT_LOG_LEVEL
protected static final String DEFAULT_NAME
protected static <T> T nullSafeValue(T value, T defaultValue)
value
if not null or the defaultValue
.T
- Class type of the given value
and defaultValue
.value
- value on which to perform the null check.defaultValue
- value to return by default if the value
is null.value
if not null or the defaultValue
.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 is set to a pre-dined, descriptive default value depending
on the type configuraiton applied.
Both 'mcast-port' and 'locators' are to set 0 and empty String respectively, which is necessary
for cache client
-based 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 BeanClassLoaderAware
protected 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 BeanFactoryAware
BeansException
protected BeanFactory beanFactory()
BeanFactory
in the current application context.BeanFactory
.IllegalStateException
- if the Spring BeanFactory
was not properly initialized.BeanFactory
public void setImportMetadata(AnnotationMetadata importMetadata)
setImportMetadata
in interface ImportAware
protected void configureCache(AnnotationMetadata importMetadata)
importMetadata
- AnnotationMetadata
containing the cache meta-data used to configure
the GemFire cache.AnnotationMetadata
protected 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 the cache meta-data used to configure
the GemFire cache.AnnotationMetadata
protected abstract Class getAnnotationType()
Annotation
type pertaining to
this configuration.Annotation
type used by this application.CacheServerApplication
,
ClientCacheApplication
,
PeerCacheApplication
protected 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
,
getAnnotationTypeName()
,
getAnnotationType()
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
,
getAnnotationTypeName()
,
getAnnotationType()
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
,
getAnnotationTypeName()
,
getAnnotationType()
protected boolean isClientPeerOrServerCacheApplication(AnnotationMetadata importMetadata)
CacheServer
,
ClientCache
or a Cache
applicationimportMetadata
- AnnotationMetadata
containing application configuration meta-data
from the annotations used to configure the Spring application.isCacheServerApplication(AnnotationMetadata)
,
isClientCacheApplication(AnnotationMetadata)
,
isPeerCacheApplication(AnnotationMetadata)
protected <T extends CacheFactoryBean> T constructCacheFactoryBean()
CacheFactoryBean
based on the application
GemFire cache type (i.e. client or peer).T
- Class type of the CacheFactoryBean
.CacheFactoryBean
for the particular application GemFire cache type
(i.e client or peer).ClientCacheFactoryBean
,
CacheFactoryBean
,
setCommonCacheConfiguration(CacheFactoryBean)
,
newCacheFactoryBean()
protected abstract <T extends CacheFactoryBean> T newCacheFactoryBean()
CacheFactoryBean
based on the application
GemFire cache type (i.e. client or peer).T
- Class type of the CacheFactoryBean
.CacheFactoryBean
for the particular application GemFire cache type
(i.e client or peer).ClientCacheFactoryBean
,
CacheFactoryBean
protected <T extends CacheFactoryBean> T setCommonCacheConfiguration(T gemfireCache)
T
- Class type of the CacheFactoryBean
.gemfireCache
- specific CacheFactoryBean
instance to configure.CacheFactoryBean
after common configuration settings have been applied.ClientCacheFactoryBean
,
CacheFactoryBean
protected 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 String name()
protected String pdxDiskStoreName()
protected Boolean pdxIgnoreUnreadFields()
protected Boolean pdxPersistent()
protected Boolean pdxReadSerialized()
protected com.gemstone.gemfire.pdx.PdxSerializer pdxSerializer()
protected List<com.gemstone.gemfire.cache.TransactionListener> transactionListeners()
protected com.gemstone.gemfire.cache.TransactionWriter transactionWriter()
protected boolean useBeanFactoryLocator()
Copyright © 2011-2015–2016 Pivotal Software, Inc.. All rights reserved.