public class CacheTypeAwareRegionFactoryBean<K,V> extends ResolvableRegionFactoryBean<K,V> implements EvictingRegionFactoryBean, ExpiringRegionFactoryBean<K,V>, SmartLifecycle
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
.Cache
,
CustomExpiry
,
DataPolicy
,
EvictionAttributes
,
ExpirationAttributes
,
GemFireCache
,
Region
,
RegionAttributes
,
RegionShortcut
,
Scope
,
ClientCache
,
ClientRegionShortcut
,
Compressor
,
GenericRegionFactoryBean
,
LocalRegionFactoryBean
,
PartitionedRegionFactoryBean
,
PeerRegionFactoryBean
,
ResolvableRegionFactoryBean
,
ReplicatedRegionFactoryBean
,
ClientRegionFactoryBean
,
RegionConfigurer
,
EvictingRegionFactoryBean
,
ExpiringRegionFactoryBean
CREATING_REGION_LOG_MESSAGE, REGION_FOUND_LOG_MESSAGE, REGION_NOT_FOUND_ERROR_MESSAGE
DEFAULT_SINGLETON
DEFAULT_PHASE
OBJECT_TYPE_ATTRIBUTE
Constructor and Description |
---|
CacheTypeAwareRegionFactoryBean() |
Modifier and Type | Method and Description |
---|---|
protected void |
configureEviction(EvictingRegionFactoryBean regionFactoryBean) |
protected void |
configureExpiration(ExpiringRegionFactoryBean<K,V> regionFactoryBean) |
org.apache.geode.cache.Region<K,V> |
createRegion(org.apache.geode.cache.GemFireCache gemfireCache,
String regionName)
Creates a new
Region with the given name . |
protected org.apache.geode.cache.RegionAttributes<K,V> |
getAttributes() |
protected org.apache.geode.cache.client.ClientRegionShortcut |
getClientRegionShortcut() |
protected Boolean |
getClose() |
protected org.apache.geode.compression.Compressor |
getCompressor()
Returns the configured
Compressor used to compress the this Region's data. |
protected org.apache.geode.cache.CustomExpiry<K,V> |
getCustomEntryIdleTimeout() |
protected org.apache.geode.cache.CustomExpiry<K,V> |
getCustomEntryTimeToLive() |
protected org.apache.geode.cache.DataPolicy |
getDataPolicy() |
protected String |
getDiskStoreName() |
protected org.apache.geode.cache.ExpirationAttributes |
getEntryIdleTimeout() |
protected org.apache.geode.cache.ExpirationAttributes |
getEntryTimeToLive() |
protected org.apache.geode.cache.EvictionAttributes |
getEvictionAttributes() |
protected Interest<K>[] |
getInterests() |
protected Class<K> |
getKeyConstraint() |
protected Boolean |
getOffHeap()
Return the configuration setting for whether the
Region's data will be managed in Off-Heap Memory. |
int |
getPhase() |
protected Optional<String> |
getPoolName() |
protected org.apache.geode.cache.ExpirationAttributes |
getRegionIdleTimeout() |
protected org.apache.geode.cache.ExpirationAttributes |
getRegionTimeToLive() |
protected org.apache.geode.cache.Scope |
getScope() |
protected org.apache.geode.cache.RegionShortcut |
getServerRegionShortcut() |
protected Optional<SmartLifecycle> |
getSmartLifecycleComponent() |
Boolean |
getStatisticsEnabled() |
protected Class<V> |
getValueConstraint() |
boolean |
isAutoStartup() |
protected boolean |
isClose() |
boolean |
isRunning() |
protected org.apache.geode.cache.Region<K,V> |
newClientRegion(org.apache.geode.cache.GemFireCache gemfireCache,
String regionName)
Constructs, configures and initialize\s a new client
Region using the ClientRegionFactoryBean . |
protected <K,V> ClientRegionFactoryBean<K,V> |
newClientRegionFactoryBean()
Constructs a new instance of the
ClientRegionFactoryBean . |
protected PeerRegionFactoryBean<K,V> |
newPeerRegionFactoryBean()
Constructs a
sub-type of the PeerRegionFactoryBean class based on
the getServerRegionShortcut() and getDataPolicy() . |
protected org.apache.geode.cache.Region<K,V> |
newServerRegion(org.apache.geode.cache.GemFireCache gemfireCache,
String regionName)
Constructs, configures and initializes a new server
Region using a sub-class
of PeerRegionFactoryBean . |
protected String |
resolvePoolName() |
void |
setAttributes(org.apache.geode.cache.RegionAttributes<K,V> regionAttributes) |
void |
setClientRegionShortcut(org.apache.geode.cache.client.ClientRegionShortcut clientRegionShortcut) |
void |
setClose(Boolean close) |
void |
setCompressor(org.apache.geode.compression.Compressor compressor)
Configures the
Compressor used to compress the this Region's data. |
void |
setCustomEntryIdleTimeout(org.apache.geode.cache.CustomExpiry<K,V> customEntryIdleTimeout) |
void |
setCustomEntryTimeToLive(org.apache.geode.cache.CustomExpiry<K,V> customEntryTimeToLive) |
void |
setDataPolicy(org.apache.geode.cache.DataPolicy dataPolicy) |
void |
setDiskStoreName(String diskStoreName) |
void |
setEntryIdleTimeout(org.apache.geode.cache.ExpirationAttributes entryIdleTimeout) |
void |
setEntryTimeToLive(org.apache.geode.cache.ExpirationAttributes entryTimeToLive) |
void |
setEvictionAttributes(org.apache.geode.cache.EvictionAttributes evictionAttributes) |
void |
setInterests(Interest<K>[] interests) |
void |
setKeyConstraint(Class<K> keyConstraint) |
void |
setOffHeap(Boolean offHeap)
Configure the
Region to manage data in Off-Heap Memory. |
void |
setPoolName(String poolName) |
void |
setRegionConfigurers(List<RegionConfigurer> regionConfigurers)
Null-safe operation used to set an
Iterable of RegionConfigurers used to apply
additional configuration to this ResolvableRegionFactoryBean when using Annotation-based configuration. |
void |
setRegionConfigurers(RegionConfigurer... regionConfigurers)
Null-safe operation used to set an array of
RegionConfigurers used to apply
additional configuration to this ResolvableRegionFactoryBean when using Annotation-based configuration. |
void |
setRegionIdleTimeout(org.apache.geode.cache.ExpirationAttributes regionIdleTimeout) |
void |
setRegionTimeToLive(org.apache.geode.cache.ExpirationAttributes regionTimeToLive) |
void |
setScope(org.apache.geode.cache.Scope scope) |
void |
setServerRegionShortcut(org.apache.geode.cache.RegionShortcut shortcut) |
void |
setStatisticsEnabled(Boolean statisticsEnabled) |
void |
setValueConstraint(Class<V> valueConstraint) |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
afterPropertiesSet, getCache, getLookupEnabled, getObject, getObjectType, getParent, getRegion, isLookupEnabled, loadSnapshot, postProcess, resolveRegionName, setCache, setLookupEnabled, setName, setParent, setRegion, setRegionName, setSnapshot
getBeanClassLoader, getBeanFactory, getBeanName, getLogger, getOptionalLogger, isDebugLoggingEnabled, isErrorLoggingEnabled, isInfoLoggingEnabled, isSingleton, isWarnLoggingEnabled, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, newLogger, setBeanClassLoader, setBeanFactory, setBeanName
public org.apache.geode.cache.Region<K,V> createRegion(org.apache.geode.cache.GemFireCache gemfireCache, String regionName) throws Exception
ResolvableRegionFactoryBean
Region
with the given name
.
This method gets called when a Region
with the specified name
does not already exist.
By default, this method implementation throws a BeanInitializationException
and it is expected
that subclasses
will override this method.createRegion
in class ResolvableRegionFactoryBean<K,V>
gemfireCache
- reference to the GemFireCache
.regionName
- name
of the new Region
.Region
with the given name
.BeanInitializationException
- by default unless a subclass
overrides this method.Exception
GemFireCache
,
Region
protected org.apache.geode.cache.Region<K,V> newClientRegion(org.apache.geode.cache.GemFireCache gemfireCache, String regionName) throws Exception
Region
using the ClientRegionFactoryBean
.gemfireCache
- reference to the GemFireCache
used to create/initialize the factory
used to create the client Region
.regionName
- name given to the client Region
.Region
with the given regionName
.Exception
- if the client Region
could not be created.ClientRegionFactoryBean
,
GemFireCache
,
Region
,
newClientRegionFactoryBean()
protected <K,V> ClientRegionFactoryBean<K,V> newClientRegionFactoryBean()
ClientRegionFactoryBean
.K
- type
of the created Region's
key.V
- type
of the created Region's
value.ClientRegionFactoryBean
.ClientRegionFactoryBean
protected org.apache.geode.cache.Region<K,V> newServerRegion(org.apache.geode.cache.GemFireCache gemfireCache, String regionName) throws Exception
Region
using a sub-class
of PeerRegionFactoryBean
.gemfireCache
- reference to the GemFireCache
used to create/initialize the factory
used to create the server Region
.regionName
- name given to the server Region
.Region
with the given regionName
.Exception
- if the server Region
could not be created.GenericRegionFactoryBean
,
GemFireCache
,
Region
,
newPeerRegionFactoryBean()
protected PeerRegionFactoryBean<K,V> newPeerRegionFactoryBean()
sub-type
of the PeerRegionFactoryBean
class based on
the getServerRegionShortcut()
and getDataPolicy()
.PeerRegionFactoryBean
.LocalRegionFactoryBean
,
PartitionedRegionFactoryBean
,
ReplicatedRegionFactoryBean
,
PeerRegionFactoryBean
protected void configureEviction(EvictingRegionFactoryBean regionFactoryBean)
protected void configureExpiration(ExpiringRegionFactoryBean<K,V> regionFactoryBean)
public void setAttributes(org.apache.geode.cache.RegionAttributes<K,V> regionAttributes)
public void setClientRegionShortcut(org.apache.geode.cache.client.ClientRegionShortcut clientRegionShortcut)
protected org.apache.geode.cache.client.ClientRegionShortcut getClientRegionShortcut()
public void setClose(Boolean close)
protected Boolean getClose()
protected boolean isClose()
public void setCompressor(org.apache.geode.compression.Compressor compressor)
Compressor
used to compress the this Region's
data.compressor
- Compressor
used to compress the this Region's
data.Compressor
protected org.apache.geode.compression.Compressor getCompressor()
Compressor
used to compress the this Region's
data.Compressor
used to compress the this Region's
data.Compressor
public void setCustomEntryIdleTimeout(org.apache.geode.cache.CustomExpiry<K,V> customEntryIdleTimeout)
setCustomEntryIdleTimeout
in interface ExpiringRegionFactoryBean<K,V>
protected org.apache.geode.cache.CustomExpiry<K,V> getCustomEntryIdleTimeout()
public void setCustomEntryTimeToLive(org.apache.geode.cache.CustomExpiry<K,V> customEntryTimeToLive)
setCustomEntryTimeToLive
in interface ExpiringRegionFactoryBean<K,V>
protected org.apache.geode.cache.CustomExpiry<K,V> getCustomEntryTimeToLive()
public void setDataPolicy(org.apache.geode.cache.DataPolicy dataPolicy)
protected org.apache.geode.cache.DataPolicy getDataPolicy()
public void setDiskStoreName(String diskStoreName)
protected String getDiskStoreName()
public void setEvictionAttributes(org.apache.geode.cache.EvictionAttributes evictionAttributes)
setEvictionAttributes
in interface EvictingRegionFactoryBean
protected org.apache.geode.cache.EvictionAttributes getEvictionAttributes()
public void setEntryIdleTimeout(org.apache.geode.cache.ExpirationAttributes entryIdleTimeout)
setEntryIdleTimeout
in interface ExpiringRegionFactoryBean<K,V>
protected org.apache.geode.cache.ExpirationAttributes getEntryIdleTimeout()
public void setEntryTimeToLive(org.apache.geode.cache.ExpirationAttributes entryTimeToLive)
setEntryTimeToLive
in interface ExpiringRegionFactoryBean<K,V>
protected org.apache.geode.cache.ExpirationAttributes getEntryTimeToLive()
public void setOffHeap(Boolean offHeap)
Region
to manage data in Off-Heap Memory.offHeap
- boolean value indicating whether the Region's
data
will be managed in Off-Heap Memory.protected Boolean getOffHeap()
Region's
data will be managed in Off-Heap Memory.Region's
data will be managed in Off-Heap Memory.public void setPoolName(String poolName)
protected String resolvePoolName()
public void setRegionConfigurers(RegionConfigurer... regionConfigurers)
RegionConfigurers
used to apply
additional configuration to this ResolvableRegionFactoryBean
when using Annotation-based configuration.regionConfigurers
- array of RegionConfigurers
used to apply
additional configuration to this ResolvableRegionFactoryBean
.RegionConfigurer
,
setRegionConfigurers(List)
public void setRegionConfigurers(List<RegionConfigurer> regionConfigurers)
Iterable
of RegionConfigurers
used to apply
additional configuration to this ResolvableRegionFactoryBean
when using Annotation-based configuration.regionConfigurers
- Iterable
of RegionConfigurers
used to apply
additional configuration to this ResolvableRegionFactoryBean
.RegionConfigurer
public void setRegionIdleTimeout(org.apache.geode.cache.ExpirationAttributes regionIdleTimeout)
setRegionIdleTimeout
in interface ExpiringRegionFactoryBean<K,V>
protected org.apache.geode.cache.ExpirationAttributes getRegionIdleTimeout()
public void setRegionTimeToLive(org.apache.geode.cache.ExpirationAttributes regionTimeToLive)
setRegionTimeToLive
in interface ExpiringRegionFactoryBean<K,V>
protected org.apache.geode.cache.ExpirationAttributes getRegionTimeToLive()
public void setScope(org.apache.geode.cache.Scope scope)
protected org.apache.geode.cache.Scope getScope()
public void setServerRegionShortcut(org.apache.geode.cache.RegionShortcut shortcut)
protected org.apache.geode.cache.RegionShortcut getServerRegionShortcut()
protected Optional<SmartLifecycle> getSmartLifecycleComponent()
public void setStatisticsEnabled(Boolean statisticsEnabled)
public Boolean getStatisticsEnabled()
public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
public int getPhase()
getPhase
in interface Phased
getPhase
in interface SmartLifecycle
public void stop(Runnable callback)
stop
in interface SmartLifecycle
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.