Spring Data for VMware GemFire
Class CacheTypeAwareRegionFactoryBean<K,V>
java.lang.Object
org.springframework.data.gemfire.support.AbstractFactoryBeanSupport<org.apache.geode.cache.Region<K,V>>
org.springframework.data.gemfire.ResolvableRegionFactoryBean<K,V>
org.springframework.data.gemfire.config.annotation.support.CacheTypeAwareRegionFactoryBean<K,V>
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.FactoryBean<org.apache.geode.cache.Region<K,,V>> org.springframework.beans.factory.InitializingBean,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,EvictingRegionFactoryBean,ExpiringRegionFactoryBean<K,V>
public class CacheTypeAwareRegionFactoryBean<K,V>
extends ResolvableRegionFactoryBean<K,V>
implements EvictingRegionFactoryBean, ExpiringRegionFactoryBean<K,V>, org.springframework.context.SmartLifecycle
The
CacheTypeAwareRegionFactoryBean class is a smart Spring FactoryBean that knows how to
create a client or server Region depending on whether the GemFireCache is a ClientCache
or a peer Cache.- Since:
- 1.9.0
- See Also:
-
CacheCustomExpiryDataPolicyEvictionAttributesExpirationAttributesGemFireCacheRegionRegionAttributesRegionShortcutScopeClientCacheClientRegionShortcutCompressorGenericRegionFactoryBeanLocalRegionFactoryBeanPartitionedRegionFactoryBeanPeerRegionFactoryBeanResolvableRegionFactoryBeanReplicatedRegionFactoryBeanClientRegionFactoryBeanRegionConfigurerEvictingRegionFactoryBeanExpiringRegionFactoryBean
-
Field Summary
Fields inherited from class org.springframework.data.gemfire.ResolvableRegionFactoryBean
CREATING_REGION_LOG_MESSAGE, REGION_FOUND_LOG_MESSAGE, REGION_NOT_FOUND_ERROR_MESSAGEFields inherited from class org.springframework.data.gemfire.support.AbstractFactoryBeanSupport
DEFAULT_SINGLETONFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureEviction(EvictingRegionFactoryBean regionFactoryBean) protected voidconfigureExpiration(ExpiringRegionFactoryBean<K, V> regionFactoryBean) createRegion(org.apache.geode.cache.GemFireCache gemfireCache, String regionName) Creates a newRegionwith the givenname.protected org.apache.geode.cache.client.ClientRegionShortcutprotected BooleangetClose()protected org.apache.geode.compression.CompressorReturns the configuredCompressorused to compress the thisRegion'sdata.protected org.apache.geode.cache.DataPolicyprotected Stringprotected org.apache.geode.cache.ExpirationAttributesprotected org.apache.geode.cache.ExpirationAttributesprotected org.apache.geode.cache.EvictionAttributesprotected BooleanReturn the configuration setting for whether theRegion'sdata will be managed in Off-Heap Memory.intgetPhase()protected org.apache.geode.cache.ExpirationAttributesprotected org.apache.geode.cache.ExpirationAttributesprotected org.apache.geode.cache.ScopegetScope()protected org.apache.geode.cache.RegionShortcutprotected Optional<org.springframework.context.SmartLifecycle>booleanprotected booleanisClose()booleannewClientRegion(org.apache.geode.cache.GemFireCache gemfireCache, String regionName) Constructs, configures and initialize\s a new clientRegionusing theClientRegionFactoryBean.protected <K,V> ClientRegionFactoryBean<K, V> Constructs a new instance of theClientRegionFactoryBean.protected PeerRegionFactoryBean<K,V> Constructs asub-typeof thePeerRegionFactoryBeanclass based on thegetServerRegionShortcut()andgetDataPolicy().newServerRegion(org.apache.geode.cache.GemFireCache gemfireCache, String regionName) Constructs, configures and initializes a new serverRegionusing a sub-class ofPeerRegionFactoryBean.protected StringvoidsetAttributes(org.apache.geode.cache.RegionAttributes<K, V> regionAttributes) voidsetClientRegionShortcut(org.apache.geode.cache.client.ClientRegionShortcut clientRegionShortcut) voidvoidsetCompressor(org.apache.geode.compression.Compressor compressor) Configures theCompressorused to compress the thisRegion'sdata.voidsetCustomEntryIdleTimeout(org.apache.geode.cache.CustomExpiry<K, V> customEntryIdleTimeout) voidsetCustomEntryTimeToLive(org.apache.geode.cache.CustomExpiry<K, V> customEntryTimeToLive) voidsetDataPolicy(org.apache.geode.cache.DataPolicy dataPolicy) voidsetDiskStoreName(String diskStoreName) voidsetEntryIdleTimeout(org.apache.geode.cache.ExpirationAttributes entryIdleTimeout) voidsetEntryTimeToLive(org.apache.geode.cache.ExpirationAttributes entryTimeToLive) voidsetEvictionAttributes(org.apache.geode.cache.EvictionAttributes evictionAttributes) voidsetInterests(Interest<K>[] interests) voidsetKeyConstraint(Class<K> keyConstraint) voidsetOffHeap(Boolean offHeap) Configure theRegionto manage data in Off-Heap Memory.voidsetPoolName(String poolName) voidsetRegionConfigurers(List<RegionConfigurer> regionConfigurers) Null-safe operation used to set anIterableofRegionConfigurersused to apply additional configuration to thisResolvableRegionFactoryBeanwhen using Annotation-based configuration.voidsetRegionConfigurers(RegionConfigurer... regionConfigurers) Null-safe operation used to set an array ofRegionConfigurersused to apply additional configuration to thisResolvableRegionFactoryBeanwhen using Annotation-based configuration.voidsetRegionIdleTimeout(org.apache.geode.cache.ExpirationAttributes regionIdleTimeout) voidsetRegionTimeToLive(org.apache.geode.cache.ExpirationAttributes regionTimeToLive) voidsetScope(org.apache.geode.cache.Scope scope) voidsetServerRegionShortcut(org.apache.geode.cache.RegionShortcut shortcut) voidsetStatisticsEnabled(Boolean statisticsEnabled) voidsetValueConstraint(Class<V> valueConstraint) voidstart()voidstop()voidMethods inherited from class org.springframework.data.gemfire.ResolvableRegionFactoryBean
afterPropertiesSet, getCache, getLookupEnabled, getObject, getObjectType, getParent, getRegion, isLookupEnabled, loadSnapshot, postProcess, resolveRegionName, setCache, setLookupEnabled, setName, setParent, setRegion, setRegionName, setSnapshotMethods inherited from class org.springframework.data.gemfire.support.AbstractFactoryBeanSupport
getBeanClassLoader, getBeanFactory, getBeanName, getLogger, getOptionalLogger, isDebugLoggingEnabled, isErrorLoggingEnabled, isInfoLoggingEnabled, isSingleton, isWarnLoggingEnabled, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, newLogger, setBeanClassLoader, setBeanFactory, setBeanName
-
Constructor Details
-
CacheTypeAwareRegionFactoryBean
public CacheTypeAwareRegionFactoryBean()
-
-
Method Details
-
createRegion
public org.apache.geode.cache.Region<K,V> createRegion(org.apache.geode.cache.GemFireCache gemfireCache, String regionName) throws Exception Description copied from class:ResolvableRegionFactoryBeanCreates a newRegionwith the givenname. This method gets called when aRegionwith the specifiednamedoes not already exist. By default, this method implementation throws aBeanInitializationExceptionand it is expected thatsubclasseswill override this method.- Overrides:
createRegionin classResolvableRegionFactoryBean<K,V> - Parameters:
gemfireCache- reference to theGemFireCache.regionName-nameof the newRegion.- Returns:
- a new
Regionwith the givenname. - Throws:
org.springframework.beans.factory.BeanInitializationException- by default unless asubclassoverrides this method.Exception- See Also:
-
GemFireCacheRegion
-
newClientRegion
protected org.apache.geode.cache.Region<K,V> newClientRegion(org.apache.geode.cache.GemFireCache gemfireCache, String regionName) throws Exception Constructs, configures and initialize\s a new clientRegionusing theClientRegionFactoryBean.- Parameters:
gemfireCache- reference to theGemFireCacheused to create/initialize the factory used to create the clientRegion.regionName- name given to the clientRegion.- Returns:
- a new instance of a client
Regionwith the givenregionName. - Throws:
Exception- if the clientRegioncould not be created.- See Also:
-
ClientRegionFactoryBeanGemFireCacheRegionnewClientRegionFactoryBean()
-
newClientRegionFactoryBean
Constructs a new instance of theClientRegionFactoryBean.- Type Parameters:
K-typeof the createdRegion'skey.V-typeof the createdRegion'svalue.- Returns:
- a new instance of the
ClientRegionFactoryBean. - See Also:
-
newServerRegion
protected org.apache.geode.cache.Region<K,V> newServerRegion(org.apache.geode.cache.GemFireCache gemfireCache, String regionName) throws Exception Constructs, configures and initializes a new serverRegionusing a sub-class ofPeerRegionFactoryBean.- Parameters:
gemfireCache- reference to theGemFireCacheused to create/initialize the factory used to create the serverRegion.regionName- name given to the serverRegion.- Returns:
- a new instance of a server
Regionwith the givenregionName. - Throws:
Exception- if the serverRegioncould not be created.- See Also:
-
GenericRegionFactoryBeanGemFireCacheRegionnewPeerRegionFactoryBean()
-
newPeerRegionFactoryBean
Constructs asub-typeof thePeerRegionFactoryBeanclass based on thegetServerRegionShortcut()andgetDataPolicy().- Returns:
- a new instance of the
PeerRegionFactoryBean. - See Also:
-
configureEviction
-
configureExpiration
-
setAttributes
-
getAttributes
-
setClientRegionShortcut
public void setClientRegionShortcut(org.apache.geode.cache.client.ClientRegionShortcut clientRegionShortcut) -
getClientRegionShortcut
protected org.apache.geode.cache.client.ClientRegionShortcut getClientRegionShortcut() -
setClose
-
getClose
-
isClose
protected boolean isClose() -
setCompressor
public void setCompressor(org.apache.geode.compression.Compressor compressor) Configures theCompressorused to compress the thisRegion'sdata.- Parameters:
compressor-Compressorused to compress the thisRegion'sdata.- See Also:
-
Compressor
-
getCompressor
protected org.apache.geode.compression.Compressor getCompressor()Returns the configuredCompressorused to compress the thisRegion'sdata.- Returns:
- the configured
Compressorused to compress the thisRegion'sdata. - See Also:
-
Compressor
-
setCustomEntryIdleTimeout
public void setCustomEntryIdleTimeout(org.apache.geode.cache.CustomExpiry<K, V> customEntryIdleTimeout) - Specified by:
setCustomEntryIdleTimeoutin interfaceExpiringRegionFactoryBean<K,V>
-
getCustomEntryIdleTimeout
-
setCustomEntryTimeToLive
public void setCustomEntryTimeToLive(org.apache.geode.cache.CustomExpiry<K, V> customEntryTimeToLive) - Specified by:
setCustomEntryTimeToLivein interfaceExpiringRegionFactoryBean<K,V>
-
getCustomEntryTimeToLive
-
setDataPolicy
public void setDataPolicy(org.apache.geode.cache.DataPolicy dataPolicy) -
getDataPolicy
protected org.apache.geode.cache.DataPolicy getDataPolicy() -
setDiskStoreName
-
getDiskStoreName
-
setEvictionAttributes
public void setEvictionAttributes(org.apache.geode.cache.EvictionAttributes evictionAttributes) - Specified by:
setEvictionAttributesin interfaceEvictingRegionFactoryBean
-
getEvictionAttributes
protected org.apache.geode.cache.EvictionAttributes getEvictionAttributes() -
setEntryIdleTimeout
public void setEntryIdleTimeout(org.apache.geode.cache.ExpirationAttributes entryIdleTimeout) - Specified by:
setEntryIdleTimeoutin interfaceExpiringRegionFactoryBean<K,V>
-
getEntryIdleTimeout
protected org.apache.geode.cache.ExpirationAttributes getEntryIdleTimeout() -
setEntryTimeToLive
public void setEntryTimeToLive(org.apache.geode.cache.ExpirationAttributes entryTimeToLive) - Specified by:
setEntryTimeToLivein interfaceExpiringRegionFactoryBean<K,V>
-
getEntryTimeToLive
protected org.apache.geode.cache.ExpirationAttributes getEntryTimeToLive() -
setInterests
-
getInterests
-
setKeyConstraint
-
getKeyConstraint
-
setOffHeap
Configure theRegionto manage data in Off-Heap Memory.- Parameters:
offHeap- boolean value indicating whether theRegion'sdata will be managed in Off-Heap Memory.
-
getOffHeap
Return the configuration setting for whether theRegion'sdata will be managed in Off-Heap Memory.- Returns:
- a boolean value indicating whether the
Region'sdata will be managed in Off-Heap Memory.
-
setPoolName
-
getPoolName
-
resolvePoolName
-
setRegionConfigurers
Null-safe operation used to set an array ofRegionConfigurersused to apply additional configuration to thisResolvableRegionFactoryBeanwhen using Annotation-based configuration.- Parameters:
regionConfigurers- array ofRegionConfigurersused to apply additional configuration to thisResolvableRegionFactoryBean.- See Also:
-
setRegionConfigurers
Null-safe operation used to set anIterableofRegionConfigurersused to apply additional configuration to thisResolvableRegionFactoryBeanwhen using Annotation-based configuration.- Parameters:
regionConfigurers-IterableofRegionConfigurersused to apply additional configuration to thisResolvableRegionFactoryBean.- See Also:
-
setRegionIdleTimeout
public void setRegionIdleTimeout(org.apache.geode.cache.ExpirationAttributes regionIdleTimeout) - Specified by:
setRegionIdleTimeoutin interfaceExpiringRegionFactoryBean<K,V>
-
getRegionIdleTimeout
protected org.apache.geode.cache.ExpirationAttributes getRegionIdleTimeout() -
setRegionTimeToLive
public void setRegionTimeToLive(org.apache.geode.cache.ExpirationAttributes regionTimeToLive) - Specified by:
setRegionTimeToLivein interfaceExpiringRegionFactoryBean<K,V>
-
getRegionTimeToLive
protected org.apache.geode.cache.ExpirationAttributes getRegionTimeToLive() -
setScope
public void setScope(org.apache.geode.cache.Scope scope) -
getScope
protected org.apache.geode.cache.Scope getScope() -
setServerRegionShortcut
public void setServerRegionShortcut(org.apache.geode.cache.RegionShortcut shortcut) -
getServerRegionShortcut
protected org.apache.geode.cache.RegionShortcut getServerRegionShortcut() -
getSmartLifecycleComponent
-
setStatisticsEnabled
-
getStatisticsEnabled
-
setValueConstraint
-
getValueConstraint
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
stop
- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-