public class ClientCacheFactoryBean extends CacheFactoryBean implements ApplicationListener<ContextRefreshedEvent>
FactoryBean
used to create a Pivotal GemFire/Apache Geode
ClientCache
.InetSocketAddress
,
GemFireCache
,
ClientCache
,
ClientCacheFactory
,
Pool
,
PoolManager
,
DistributedSystem
,
PdxSerializer
,
BeanFactory
,
ApplicationContext
,
ApplicationListener
,
ContextRefreshedEvent
,
CacheFactoryBean
,
ClientCacheConfigurer
,
ConnectionEndpoint
,
ConnectionEndpointList
CacheFactoryBean.CacheFactoryInitializer<T>, CacheFactoryBean.DynamicRegionSupport, CacheFactoryBean.JndiDataSource
Modifier and Type | Field and Description |
---|---|
protected static PoolResolver |
DEFAULT_POOL_RESOLVER |
beanFactoryLocator
DEFAULT_SINGLETON
OBJECT_TYPE_ATTRIBUTE
Constructor and Description |
---|
ClientCacheFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
addLocators(ConnectionEndpoint... locators) |
void |
addLocators(Iterable<ConnectionEndpoint> locators) |
void |
addServers(ConnectionEndpoint... servers) |
void |
addServers(Iterable<ConnectionEndpoint> servers) |
protected void |
applyCacheConfigurers()
Applies the composite
ClientCacheConfigurers
to this ClientCacheFactoryBean . |
protected void |
applyClientCacheConfigurers(ClientCacheConfigurer... clientCacheConfigurers)
Null-safe operation to apply the given array of
ClientCacheConfigurers
to this ClientCacheFactoryBean . |
protected void |
applyClientCacheConfigurers(Iterable<ClientCacheConfigurer> clientCacheConfigurers)
Null-safe operation to apply the given
Iterable of ClientCacheConfigurers
to this ClientCacheFactoryBean . |
protected void |
close(org.apache.geode.cache.GemFireCache cache)
Null-safe internal method used to close the
ClientCache and preserve durability. |
protected Object |
configureFactory(Object factory)
Configures the
ClientCacheFactory used to create the ClientCache . |
protected <T extends org.apache.geode.cache.GemFireCache> |
createCache(Object factory)
Creates a new
ClientCache instance using the provided factory. |
protected Object |
createFactory(Properties gemfireProperties)
Constructs a new instance of
ClientCacheFactory initialized with the given Pivotal GemFire/Apache Geode
Properties used to construct, configure and initialize an instance of a ClientCache . |
protected <T extends org.apache.geode.cache.GemFireCache> |
fetchCache()
Fetches an existing
ClientCache instance from the ClientCacheFactory . |
ClientCacheConfigurer |
getCompositeClientCacheConfigurer()
Returns a reference to the Composite
ClientCacheConfigurer used to apply additional configuration
to this ClientCacheFactoryBean on Spring container initialization. |
String |
getDurableClientId()
Gets the value of the Pivotal GemFire System property 'durable-client-id' indicating to the server whether
this client is durable.
|
Integer |
getDurableClientTimeout()
Get the value of the Pivotal GemFire System property 'durable-client-timeout' indicating to the server how long
to track events for the durable client when disconnected.
|
Boolean |
getEnableAutoReconnect()
Gets the value for the auto-reconnect setting.
|
Integer |
getFreeConnectionTimeout() |
Long |
getIdleTimeout() |
Boolean |
getKeepAlive()
Gets the user specified value for whether the server(s) should keep the durable client's queue alive
for the duration of the timeout when the client voluntarily disconnects.
|
Integer |
getLoadConditioningInterval() |
protected ConnectionEndpointList |
getLocators() |
Integer |
getMaxConnections() |
Integer |
getMinConnections() |
Boolean |
getMultiUserAuthentication() |
Class<? extends org.apache.geode.cache.GemFireCache> |
getObjectType()
|
Long |
getPingInterval() |
org.apache.geode.cache.client.Pool |
getPool()
Gets the
Pool used by this ClientCache to obtain connections to the Apache Geode cluster. |
String |
getPoolName()
Gets the
name of the Pool used by this ClientCache to obtain connections to
the Apache Geode cluster. |
@NonNull PoolResolver |
getPoolResolver()
|
Boolean |
getPrSingleHopEnabled() |
Integer |
getReadTimeout() |
Boolean |
getReadyForEvents()
Gets the user-specified value for the readyForEvents property.
|
Integer |
getRetryAttempts() |
String |
getServerGroup() |
protected ConnectionEndpointList |
getServers() |
Integer |
getSocketBufferSize() |
Integer |
getSocketConnectTimeout() |
Integer |
getStatisticsInterval() |
Integer |
getSubscriptionAckInterval() |
Boolean |
getSubscriptionEnabled() |
Integer |
getSubscriptionMessageTrackingTimeout() |
Integer |
getSubscriptionRedundancy() |
Boolean |
getThreadLocalConnections() |
Boolean |
getUseClusterConfiguration()
Return the state of the use-shared-configuration Pivotal GemFire/Apache Geode
distribution configuration setting.
|
boolean |
isKeepAlive()
Determines whether the server(s) should keep the durable client's queue alive for the duration of the timeout
when the client voluntarily disconnects.
|
boolean |
isReadyForEvents()
Determines whether this Pivotal GemFire cache client is ready for events.
|
void |
onApplicationEvent(ContextRefreshedEvent event)
Inform the Pivotal GemFire/Apache Geode cluster that this cache client is ready to receive events
iff the client is non-durable.
|
protected Properties |
resolveProperties()
Resolves the Pivotal GemFire/Apache Geode
Properties used to configure the ClientCache . |
void |
setClientCacheConfigurers(ClientCacheConfigurer... clientCacheConfigurers)
Null-safe operation to set an array of
ClientCacheConfigurers used to apply
additional configuration to this ClientCacheFactoryBean when using Annotation-based configuration. |
void |
setClientCacheConfigurers(List<ClientCacheConfigurer> peerCacheConfigurers)
Null-safe operation to set an
Iterable of ClientCacheConfigurers to apply
additional configuration to this ClientCacheFactoryBean when using Annotation-based configuration. |
void |
setDurableClientId(String durableClientId)
Set the Pivotal GemFire System property 'durable-client-id' to indicate to the server that this client is durable.
|
void |
setDurableClientTimeout(Integer durableClientTimeout)
Set the Pivotal GemFire System property 'durable-client-timeout' indicating to the server how long to track events
for the durable client when disconnected.
|
void |
setEnableAutoReconnect(Boolean enableAutoReconnect)
Controls whether auto-reconnect functionality introduced in Pivotal GemFire 8 is enabled or not.
|
void |
setFreeConnectionTimeout(Integer freeConnectionTimeout) |
void |
setIdleTimeout(Long idleTimeout) |
void |
setKeepAlive(Boolean keepAlive)
Sets whether the server(s) should keep the durable client's queue alive for the duration of the timeout
when the client voluntarily disconnects.
|
void |
setLoadConditioningInterval(Integer loadConditioningInterval) |
void |
setLocators(ConnectionEndpoint[] locators) |
void |
setLocators(Iterable<ConnectionEndpoint> locators) |
void |
setMaxConnections(Integer maxConnections) |
void |
setMinConnections(Integer minConnections) |
void |
setMultiUserAuthentication(Boolean multiUserAuthentication) |
void |
setPingInterval(Long pingInterval) |
void |
setPool(org.apache.geode.cache.client.Pool pool)
Sets the
Pool used by this ClientCache to obtain connections to the Apache Geode cluster. |
void |
setPoolName(String poolName)
Sets the
name of the Pool used by this ClientCache to obtain connections to
the Apache Geode cluster. |
void |
setPoolResolver(PoolResolver poolResolver)
|
void |
setPrSingleHopEnabled(Boolean prSingleHopEnabled) |
void |
setReadTimeout(Integer readTimeout) |
void |
setReadyForEvents(Boolean readyForEvents)
Sets the readyForEvents property to indicate whether the cache client should notify the server
that it is ready to receive updates.
|
void |
setRetryAttempts(Integer retryAttempts) |
void |
setServerGroup(String serverGroup) |
void |
setServers(ConnectionEndpoint[] servers) |
void |
setServers(Iterable<ConnectionEndpoint> servers) |
void |
setSocketBufferSize(Integer socketBufferSize) |
void |
setSocketConnectTimeout(Integer socketConnectTimeout) |
void |
setStatisticsInterval(Integer statisticsInterval) |
void |
setSubscriptionAckInterval(Integer subscriptionAckInterval) |
void |
setSubscriptionEnabled(Boolean subscriptionEnabled) |
void |
setSubscriptionMessageTrackingTimeout(Integer subscriptionMessageTrackingTimeout) |
void |
setSubscriptionRedundancy(Integer subscriptionRedundancy) |
void |
setThreadLocalConnections(Boolean threadLocalConnections) |
void |
setUseClusterConfiguration(Boolean useClusterConfiguration)
Sets the state of the use-shared-configuration Pivotal GemFire/Apache Geode
distribution configuration setting.
|
afterPropertiesSet, applyPeerCacheConfigurers, applyPeerCacheConfigurers, destroy, getBeanFactoryLocator, getCache, getCacheFactoryInitializer, getCacheXml, getCompositePeerCacheConfigurer, getCopyOnRead, getCriticalHeapPercentage, getCriticalOffHeapPercentage, getDynamicRegionSupport, getEvictionHeapPercentage, getEvictionOffHeapPercentage, getGatewayConflictResolver, getJndiDataSources, getLockLease, getLockTimeout, getMessageSyncInterval, getObject, getPdxDiskStoreName, getPdxIgnoreUnreadFields, getPdxPersistent, getPdxReadSerialized, getPdxSerializer, getPhase, getProperties, getSearchTimeout, getSecurityManager, getTransactionListeners, getTransactionWriter, initializeFactory, isClose, isUseBeanFactoryLocator, postProcess, postProcess, resolveCache, setAndGetProperties, setCache, setCacheFactoryInitializer, setCacheXml, setClose, setCopyOnRead, setCriticalHeapPercentage, setCriticalOffHeapPercentage, setDynamicRegionSupport, setEvictionHeapPercentage, setEvictionOffHeapPercentage, setGatewayConflictResolver, setJndiDataSources, setLockLease, setLockTimeout, setMessageSyncInterval, setPdxDiskStoreName, setPdxIgnoreUnreadFields, setPdxPersistent, setPdxReadSerialized, setPdxSerializer, setPeerCacheConfigurers, setPeerCacheConfigurers, setPhase, setProperties, setSearchTimeout, setSecurityManager, setTransactionListeners, setTransactionWriter, setUseBeanFactoryLocator, translateExceptionIfPossible
getBeanClassLoader, getBeanFactory, getBeanName, getLog, isSingleton, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, newLog, setBeanClassLoader, setBeanFactory, setBeanName
protected static final PoolResolver DEFAULT_POOL_RESOLVER
protected void applyCacheConfigurers()
ClientCacheConfigurers
to this ClientCacheFactoryBean
.applyCacheConfigurers
in class CacheFactoryBean
getCompositeClientCacheConfigurer()
,
applyClientCacheConfigurers(ClientCacheConfigurer...)
protected void applyClientCacheConfigurers(ClientCacheConfigurer... clientCacheConfigurers)
ClientCacheConfigurers
to this ClientCacheFactoryBean
.clientCacheConfigurers
- array of ClientCacheConfigurers
applied to
this ClientCacheFactoryBean
.ClientCacheConfigurer
,
applyClientCacheConfigurers(Iterable)
protected void applyClientCacheConfigurers(Iterable<ClientCacheConfigurer> clientCacheConfigurers)
Iterable
of ClientCacheConfigurers
to this ClientCacheFactoryBean
.clientCacheConfigurers
- Iterable
of ClientCacheConfigurers
applied to this ClientCacheFactoryBean
.ClientCacheConfigurer
,
Iterable
protected <T extends org.apache.geode.cache.GemFireCache> T fetchCache()
ClientCache
instance from the ClientCacheFactory
.fetchCache
in class CacheFactoryBean
T
- parameterized Class
type extension of GemFireCache
.ClientCache
instance if available.org.apache.geode.cache.CacheClosedException
- if an existing ClientCache
instance does not exist.ClientCacheFactory.getAnyInstance()
,
GemFireCache
,
CacheFactoryBean.getCache()
protected Properties resolveProperties()
Properties
used to configure the ClientCache
.resolveProperties
in class CacheFactoryBean
Properties
used to configure the ClientCache
.DistributedSystem.getProperties()
,
getDistributedSystem()
protected Object createFactory(Properties gemfireProperties)
ClientCacheFactory
initialized with the given Pivotal GemFire/Apache Geode
Properties
used to construct, configure and initialize an instance of a ClientCache
.createFactory
in class CacheFactoryBean
gemfireProperties
- Properties
used by the ClientCacheFactory
to configure the ClientCache
.ClientCacheFactory
initialized with
the given Pivotal GemFire/Apache Geode Properties
.ClientCacheFactory
,
Properties
protected Object configureFactory(Object factory)
ClientCacheFactory
used to create the ClientCache
.
Sets PDX options specified by the user.
Sets Pool options specified by the user.configureFactory
in class CacheFactoryBean
factory
- ClientCacheFactory
used to create the ClientCache
.ClientCacheFactory
.configurePdx(ClientCacheFactory)
protected <T extends org.apache.geode.cache.GemFireCache> T createCache(Object factory)
ClientCache
instance using the provided factory.createCache
in class CacheFactoryBean
T
- parameterized Class
type extension of GemFireCache
.factory
- instance of ClientCacheFactory
.ClientCache
created by the provided factory.ClientCacheFactory.create()
,
GemFireCache
public void onApplicationEvent(ContextRefreshedEvent event)
onApplicationEvent
in interface ApplicationListener<ContextRefreshedEvent>
event
- ApplicationContextEvent
fired when the ApplicationContext
is refreshed.ClientCache.readyForEvents()
,
isReadyForEvents()
,
fetchCache()
protected void close(org.apache.geode.cache.GemFireCache cache)
ClientCache
and preserve durability.close
in class CacheFactoryBean
cache
- GemFireCache
to close.ClientCache.close(boolean)
,
isKeepAlive()
public Class<? extends org.apache.geode.cache.GemFireCache> getObjectType()
getObjectType
in interface FactoryBean<org.apache.geode.cache.GemFireCache>
getObjectType
in class CacheFactoryBean
Class
type of the GemFireCache
produced by this ClientCacheFactoryBean
.FactoryBean.getObjectType()
public void addLocators(ConnectionEndpoint... locators)
public void addLocators(Iterable<ConnectionEndpoint> locators)
public void addServers(ConnectionEndpoint... servers)
public void addServers(Iterable<ConnectionEndpoint> servers)
public void setClientCacheConfigurers(ClientCacheConfigurer... clientCacheConfigurers)
ClientCacheConfigurers
used to apply
additional configuration to this ClientCacheFactoryBean
when using Annotation-based configuration.clientCacheConfigurers
- array of ClientCacheConfigurers
used to apply
additional configuration to this ClientCacheFactoryBean
.ClientCacheConfigurer
,
setClientCacheConfigurers(List)
public void setClientCacheConfigurers(List<ClientCacheConfigurer> peerCacheConfigurers)
Iterable
of ClientCacheConfigurers
to apply
additional configuration to this ClientCacheFactoryBean
when using Annotation-based configuration.peerCacheConfigurers
- Iterable
of ClientCacheConfigurers
used to apply
additional configuration to this ClientCacheFactoryBean
.ClientCacheConfigurer
public ClientCacheConfigurer getCompositeClientCacheConfigurer()
ClientCacheConfigurer
used to apply additional configuration
to this ClientCacheFactoryBean
on Spring container initialization.ClientCacheConfigurer
.ClientCacheConfigurer
public void setDurableClientId(String durableClientId)
durableClientId
- a String value indicating the durable client id.public String getDurableClientId()
public void setDurableClientTimeout(Integer durableClientTimeout)
durableClientTimeout
- an Integer value indicating the timeout in seconds for the server to keep
the durable client's queue around.public Integer getDurableClientTimeout()
public final void setEnableAutoReconnect(Boolean enableAutoReconnect)
CacheFactoryBean
setEnableAutoReconnect
in class CacheFactoryBean
enableAutoReconnect
- a boolean value to enable/disable auto-reconnect functionality.public final Boolean getEnableAutoReconnect()
CacheFactoryBean
getEnableAutoReconnect
in class CacheFactoryBean
public void setFreeConnectionTimeout(Integer freeConnectionTimeout)
public Integer getFreeConnectionTimeout()
public void setIdleTimeout(Long idleTimeout)
public Long getIdleTimeout()
public void setKeepAlive(Boolean keepAlive)
keepAlive
- a boolean value indicating to the server to keep the durable client's queues alive.public Boolean getKeepAlive()
public boolean isKeepAlive()
public void setLoadConditioningInterval(Integer loadConditioningInterval)
public Integer getLoadConditioningInterval()
public void setLocators(ConnectionEndpoint[] locators)
public void setLocators(Iterable<ConnectionEndpoint> locators)
protected ConnectionEndpointList getLocators()
public void setMaxConnections(Integer maxConnections)
public Integer getMaxConnections()
public void setMinConnections(Integer minConnections)
public Integer getMinConnections()
public void setMultiUserAuthentication(Boolean multiUserAuthentication)
public Boolean getMultiUserAuthentication()
public void setPool(org.apache.geode.cache.client.Pool pool)
Pool
used by this ClientCache
to obtain connections to the Apache Geode cluster.pool
- Pool
used by this ClientCache
to obtain connections to the Apache Geode cluster.Pool
public org.apache.geode.cache.client.Pool getPool()
Pool
used by this ClientCache
to obtain connections to the Apache Geode cluster.Pool
used by this ClientCache
to obtain connections to the Apache Geode cluster.Pool
public void setPoolName(String poolName)
name
of the Pool
used by this ClientCache
to obtain connections to
the Apache Geode cluster.poolName
- name
of the Pool
used by this ClientCache
to obtain connections to
the Apache Geode cluster.public String getPoolName()
name
of the Pool
used by this ClientCache
to obtain connections to
the Apache Geode cluster.name
of the Pool
used by this ClientCache
to obtain connections to
the Apache Geode cluster.public void setPoolResolver(@Nullable PoolResolver poolResolver)
PoolResolver
used by this ClientCache
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 @NonNull PoolResolver getPoolResolver()
PoolResolver
. If no PoolResolver
was configured, then return the default,
PoolManagerPoolResolver
.PoolResolver
,
PoolManagerPoolResolver
public void setPingInterval(Long pingInterval)
public Long getPingInterval()
public void setPrSingleHopEnabled(Boolean prSingleHopEnabled)
public Boolean getPrSingleHopEnabled()
public void setReadTimeout(Integer readTimeout)
public Integer getReadTimeout()
public void setReadyForEvents(Boolean readyForEvents)
readyForEvents
- sets a boolean flag to notify the server that this durable client
is ready to receive updates.getReadyForEvents()
public Boolean getReadyForEvents()
public boolean isReadyForEvents()
CacheUtils.isDurable(ClientCache)
,
getReadyForEvents()
public void setRetryAttempts(Integer retryAttempts)
public Integer getRetryAttempts()
public void setServerGroup(String serverGroup)
public String getServerGroup()
public void setServers(ConnectionEndpoint[] servers)
public void setServers(Iterable<ConnectionEndpoint> servers)
protected ConnectionEndpointList getServers()
public void setSocketBufferSize(Integer socketBufferSize)
public Integer getSocketBufferSize()
public void setSocketConnectTimeout(Integer socketConnectTimeout)
public Integer getSocketConnectTimeout()
public void setStatisticsInterval(Integer statisticsInterval)
public Integer getStatisticsInterval()
public void setSubscriptionAckInterval(Integer subscriptionAckInterval)
public Integer getSubscriptionAckInterval()
public void setSubscriptionEnabled(Boolean subscriptionEnabled)
public Boolean getSubscriptionEnabled()
public void setSubscriptionMessageTrackingTimeout(Integer subscriptionMessageTrackingTimeout)
public Integer getSubscriptionMessageTrackingTimeout()
public void setSubscriptionRedundancy(Integer subscriptionRedundancy)
public Integer getSubscriptionRedundancy()
public void setThreadLocalConnections(Boolean threadLocalConnections)
public Boolean getThreadLocalConnections()
public final void setUseClusterConfiguration(Boolean useClusterConfiguration)
CacheFactoryBean
setUseClusterConfiguration
in class CacheFactoryBean
useClusterConfiguration
- boolean value to set the use-shared-configuration
Pivotal GemFire/Apache Geode distribution configuration setting.public final Boolean getUseClusterConfiguration()
CacheFactoryBean
getUseClusterConfiguration
in class CacheFactoryBean
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.