public class ClientRegionFactoryBean<K,V> extends ConfigurableRegionFactoryBean<K,V> implements SmartLifecycleSupport, EvictingRegionFactoryBean, ExpiringRegionFactoryBean<K,V>, DisposableBean
FactoryBean used to construct, configure and initialize a client Region.CacheListener,
CacheLoader,
CacheWriter,
CustomExpiry,
DataPolicy,
EvictionAttributes,
ExpirationAttributes,
GemFireCache,
Region,
RegionAttributes,
ClientCache,
ClientRegionFactory,
ClientRegionShortcut,
Pool,
Compressor,
DisposableBean,
FactoryBean,
ConfigurableRegionFactoryBean,
PoolResolver,
RegionConfigurer,
EvictingRegionFactoryBean,
ExpiringRegionFactoryBean,
SmartLifecycleSupport| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_POOL_NAME |
static String |
GEMFIRE_POOL_NAME |
CREATING_REGION_LOG_MESSAGE, REGION_FOUND_LOG_MESSAGE, REGION_NOT_FOUND_ERROR_MESSAGEDEFAULT_SINGLETONDEFAULT_AUTO_STARTUP, DEFAULT_IS_RUNNING, DEFAULT_PHASEOBJECT_TYPE_ATTRIBUTE| Constructor and Description |
|---|
ClientRegionFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Initializes a the instance of
ClientRegionFactoryBean. |
protected org.apache.geode.cache.client.ClientRegionFactory<K,V> |
configure(org.apache.geode.cache.client.ClientRegionFactory<K,V> clientRegionFactory)
Configures the given
ClientRegionFactoryBean from the configuration settings
of this ClientRegionFactoryBean and any RegionAttributes. |
protected org.apache.geode.cache.client.ClientRegionFactory<K,V> |
createClientRegionFactory(org.apache.geode.cache.client.ClientCache clientCache,
org.apache.geode.cache.client.ClientRegionShortcut clientRegionShortcut)
Constructs a new instance of
ClientRegionFactory using the given ClientCache
and ClientRegionShortcut. |
protected org.apache.geode.cache.Region<K,V> |
createRegion(org.apache.geode.cache.GemFireCache gemfireCache,
String regionName)
Creates a new
Region with the given name. |
void |
destroy()
Closes and destroys the
Region. |
protected org.apache.geode.cache.RegionAttributes<K,V> |
getAttributes()
Gets the
RegionAttributes used to configure the client Region
created by this ClientRegionFactoryBean. |
PoolResolver |
getDefaultPoolResolver()
Gets a reference to the configured, default
PoolResolver used by this client Region to resolve
Pool objects if a explicit PoolResolver was not configured. |
Optional<String> |
getPoolName()
|
PoolResolver |
getPoolResolver()
|
Boolean |
getStatisticsEnabled() |
protected boolean |
isNotPersistent() |
protected boolean |
isPersistent() |
boolean |
isStatisticsEnabled() |
protected org.apache.geode.cache.client.ClientRegionFactory<K,V> |
postProcess(org.apache.geode.cache.client.ClientRegionFactory<K,V> clientRegionFactory)
Post-process the given
ClientRegionFactory setup by this ClientRegionFactoryBean. |
protected org.apache.geode.cache.Region<K,V> |
postProcess(org.apache.geode.cache.Region<K,V> region)
Post-process the
Region created by this ClientRegionFactoryBean. |
protected boolean |
resolveStatisticsEnabled() |
void |
setAttributes(org.apache.geode.cache.RegionAttributes<K,V> attributes)
Sets the region attributes used for the region used by this factory.
|
void |
setCacheListeners(org.apache.geode.cache.CacheListener<K,V>[] cacheListeners)
Sets the cache listeners used for the region used by this factory.
|
void |
setCacheLoader(org.apache.geode.cache.CacheLoader<K,V> cacheLoader)
Sets the CacheLoader used to load data local to the client's Region on cache misses.
|
void |
setCacheWriter(org.apache.geode.cache.CacheWriter<K,V> cacheWriter)
Sets the CacheWriter used to perform a synchronous write-behind when data is put into the client's Region.
|
void |
setCloningEnabled(Boolean cloningEnabled) |
void |
setClose(boolean close)
Indicates whether the region referred by this factory bean will be closed on shutdown (default true).
|
void |
setCompressor(org.apache.geode.compression.Compressor compressor)
Configures the
Compressor used to compress the this Region's data. |
void |
setConcurrencyChecksEnabled(Boolean concurrencyChecksEnabled) |
void |
setConcurrencyLevel(Integer concurrencyLevel) |
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)
Sets the Data Policy.
|
void |
setDestroy(boolean destroy)
Indicates whether the region referred by this factory bean will be
destroyed on shutdown (default false).
|
void |
setDiskStoreName(String diskStoreName)
Sets the name of disk store to use for overflow and persistence
|
void |
setDiskSynchronous(Boolean diskSynchronous) |
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 |
setInitialCapacity(Integer initialCapacity) |
void |
setInterests(Interest<K>[] interests)
Set the interests for this client region.
|
void |
setKeyConstraint(Class<K> keyConstraint)
Sets a
type constraint on this client Region's keys. |
void |
setLoadFactor(Float loadFactor) |
void |
setPersistent(boolean persistent)
Configures whether this
client Region is persistent, i.e. stores data to disk. |
void |
setPool(org.apache.geode.cache.client.Pool pool)
Configures the
Pool used by this client Region. |
void |
setPoolName(String poolName)
|
void |
setPoolResolver(PoolResolver poolResolver)
|
void |
setRegionIdleTimeout(org.apache.geode.cache.ExpirationAttributes regionIdleTimeout) |
void |
setRegionTimeToLive(org.apache.geode.cache.ExpirationAttributes regionTimeToLive) |
void |
setShortcut(org.apache.geode.cache.client.ClientRegionShortcut shortcut)
Initializes the
DataPolicy of the client Region
using the given ClientRegionShortcut. |
void |
setStatisticsEnabled(Boolean statisticsEnabled) |
void |
setValueConstraint(Class<V> valueConstraint)
Sets a
type constraint on this client Region's values. |
void |
start()
Registers interests in the startup lifecycle phase of the Spring container.
|
applyRegionConfigurers, applyRegionConfigurers, applyRegionConfigurers, getCompositeRegionConfigurer, setRegionConfigurers, setRegionConfigurersgetCache, getLookupEnabled, getObject, getObjectType, getParent, getRegion, isLookupEnabled, loadSnapshot, resolveRegionName, setCache, setLookupEnabled, setName, setParent, setRegion, setRegionName, setSnapshotgetBeanClassLoader, getBeanFactory, getBeanName, getLogger, getOptionalLogger, isDebugLoggingEnabled, isErrorLoggingEnabled, isInfoLoggingEnabled, isSingleton, isWarnLoggingEnabled, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, newLogger, setBeanClassLoader, setBeanFactory, setBeanNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPhase, isAutoStartup, isRunning, stop, stoppublic static final String DEFAULT_POOL_NAME
public static final String GEMFIRE_POOL_NAME
public void afterPropertiesSet()
throws Exception
ClientRegionFactoryBean.afterPropertiesSet in interface InitializingBeanafterPropertiesSet in class ConfigurableRegionFactoryBean<K,V>Exception - if initialization fails.InitializingBean.afterPropertiesSet(),
ResolvableRegionFactoryBean.createRegion(GemFireCache, String)protected org.apache.geode.cache.Region<K,V> createRegion(org.apache.geode.cache.GemFireCache gemfireCache, String regionName)
Region with the given name.createRegion in class ResolvableRegionFactoryBean<K,V>gemfireCache - reference to the GemFireCache.regionName - name of the new Region.Region with the given name.createClientRegionFactory(ClientCache, ClientRegionShortcut),
newRegion(ClientRegionFactory, Region, String),
GemFireCache,
Regionprotected org.apache.geode.cache.client.ClientRegionFactory<K,V> createClientRegionFactory(org.apache.geode.cache.client.ClientCache clientCache, org.apache.geode.cache.client.ClientRegionShortcut clientRegionShortcut)
ClientRegionFactory using the given ClientCache
and ClientRegionShortcut.clientCache - reference to the ClientCache.clientRegionShortcut - ClientRegionShortcut used to configure
the client Region DataPolicy.ClientRegionFactory.ClientCache.createClientRegionFactory(ClientRegionShortcut),
ClientRegionShortcut,
ClientRegionFactoryprotected org.apache.geode.cache.client.ClientRegionFactory<K,V> configure(org.apache.geode.cache.client.ClientRegionFactory<K,V> clientRegionFactory)
ClientRegionFactoryBean from the configuration settings
of this ClientRegionFactoryBean and any RegionAttributes.clientRegionFactory - ClientRegionFactory to configure.ClientRegionFactory.ClientRegionFactoryprotected org.apache.geode.cache.client.ClientRegionFactory<K,V> postProcess(org.apache.geode.cache.client.ClientRegionFactory<K,V> clientRegionFactory)
ClientRegionFactory setup by this ClientRegionFactoryBean.clientRegionFactory - ClientRegionFactory to process.ClientRegionFactory.ClientRegionFactoryprotected org.apache.geode.cache.Region<K,V> postProcess(org.apache.geode.cache.Region<K,V> region)
Region created by this ClientRegionFactoryBean.postProcess in class ResolvableRegionFactoryBean<K,V>region - Region to process.Regionpublic void start()
start in interface LifecycleResolvableRegionFactoryBean.getRegion(),
registerInterests(Region)public void destroy()
throws Exception
Region.destroy in interface DisposableBeanException - if destroy fails.DisposableBeanpublic void setAttributes(org.apache.geode.cache.RegionAttributes<K,V> attributes)
attributes - the attributes to set on a newly created regionprotected org.apache.geode.cache.RegionAttributes<K,V> getAttributes()
RegionAttributes used to configure the client Region
created by this ClientRegionFactoryBean.RegionAttributes used to configure the client Region.RegionAttributespublic void setCacheListeners(org.apache.geode.cache.CacheListener<K,V>[] cacheListeners)
setAttributes(RegionAttributes).cacheListeners - the cacheListeners to set on a newly created regionpublic void setCacheLoader(org.apache.geode.cache.CacheLoader<K,V> cacheLoader)
cacheLoader - a GemFire CacheLoader used to load data into the client Region.CacheLoaderpublic void setCacheWriter(org.apache.geode.cache.CacheWriter<K,V> cacheWriter)
cacheWriter - the GemFire CacheWriter used to perform synchronous write-behinds on put ops.CacheWriterpublic void setCloningEnabled(Boolean cloningEnabled)
public void setClose(boolean close)
close - whether to close or not the regionsetDestroy(boolean)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.Compressorpublic void setConcurrencyChecksEnabled(Boolean concurrencyChecksEnabled)
public void setConcurrencyLevel(Integer concurrencyLevel)
public void setCustomEntryIdleTimeout(org.apache.geode.cache.CustomExpiry<K,V> customEntryIdleTimeout)
setCustomEntryIdleTimeout in interface ExpiringRegionFactoryBean<K,V>public void setCustomEntryTimeToLive(org.apache.geode.cache.CustomExpiry<K,V> customEntryTimeToLive)
setCustomEntryTimeToLive in interface ExpiringRegionFactoryBean<K,V>public void setDataPolicy(org.apache.geode.cache.DataPolicy dataPolicy)
dataPolicy - the client Region's Data Policy.DataPolicypublic void setDestroy(boolean destroy)
destroy - whether or not to destroy the regionsetClose(boolean)public void setDiskStoreName(String diskStoreName)
diskStoreName - a String specifying the 'name' of the client Region Disk Store.public void setDiskSynchronous(Boolean diskSynchronous)
public void setEntryIdleTimeout(org.apache.geode.cache.ExpirationAttributes entryIdleTimeout)
setEntryIdleTimeout in interface ExpiringRegionFactoryBean<K,V>public void setEntryTimeToLive(org.apache.geode.cache.ExpirationAttributes entryTimeToLive)
setEntryTimeToLive in interface ExpiringRegionFactoryBean<K,V>public void setEvictionAttributes(org.apache.geode.cache.EvictionAttributes evictionAttributes)
setEvictionAttributes in interface EvictingRegionFactoryBeanpublic void setInitialCapacity(Integer initialCapacity)
public void setInterests(Interest<K>[] interests)
interests - the interests to setpublic void setKeyConstraint(Class<K> keyConstraint)
type constraint on this client Region's keys.public void setLoadFactor(Float loadFactor)
protected boolean isPersistent()
protected boolean isNotPersistent()
public void setPersistent(boolean persistent)
client Region is persistent, i.e. stores data to disk.persistent - boolean value used to enable disk persistence.public void setPool(org.apache.geode.cache.client.Pool pool)
Pool used by this client Region.pool - Pool used by this client Region to send/receive data to/from the server.Pool,
setPoolName(String)public void setPoolName(String poolName)
poolName - String containing the name of the client Pool
to be used by this client Region.getPoolName(),
setPool(Pool)public Optional<String> getPoolName()
Optional name of the configured Pool to be used by
this client Region.setPoolName(String)public void setPoolResolver(@Nullable PoolResolver poolResolver)
PoolResolver used by this client Region to resolve Pool objects.
The Pool objects may be managed or un-managed depending on the PoolResolver implementation.poolResolver - PoolResolver used to resolve the configured Pool.PoolResolver@NonNull public PoolResolver getPoolResolver()
PoolResolver. If no PoolResolver was configured, then return the default,
PoolManagerPoolResolver.PoolResolver,
getDefaultPoolResolver()@NonNull public PoolResolver getDefaultPoolResolver()
PoolResolver used by this client Region to resolve
Pool objects if a explicit PoolResolver was not configured.
The default PoolResolver uses a composition of the BeanFactoryPoolResolver
and PoolManagerPoolResolver to fallback on.PoolResolver.BeanFactoryPoolResolver,
PoolManagerPoolResolver,
PoolResolverpublic void setRegionIdleTimeout(org.apache.geode.cache.ExpirationAttributes regionIdleTimeout)
setRegionIdleTimeout in interface ExpiringRegionFactoryBean<K,V>public void setRegionTimeToLive(org.apache.geode.cache.ExpirationAttributes regionTimeToLive)
setRegionTimeToLive in interface ExpiringRegionFactoryBean<K,V>public void setShortcut(org.apache.geode.cache.client.ClientRegionShortcut shortcut)
DataPolicy of the client Region
using the given ClientRegionShortcut.shortcut - ClientRegionShortcut used to initialize the DataPolicy
of this client Region.ClientRegionShortcutpublic void setStatisticsEnabled(Boolean statisticsEnabled)
public Boolean getStatisticsEnabled()
public boolean isStatisticsEnabled()
protected boolean resolveStatisticsEnabled()
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.