public class ClientCacheFactoryBean extends CacheFactoryBean implements ApplicationListener<ContextRefreshedEvent>
FactoryBean
used to construct, configure and initialize a ClientCache
.InetSocketAddress
,
Properties
,
GemFireCache
,
ClientCache
,
ClientCacheFactory
,
Pool
,
SocketFactory
,
DistributedSystem
,
PdxSerializer
,
FactoryBean
,
ApplicationContext
,
ApplicationListener
,
ApplicationContextEvent
,
ContextRefreshedEvent
,
CacheFactoryBean
,
ClientCacheConfigurer
Modifier and Type | Class and Description |
---|---|
static class |
ClientCacheFactoryBean.ClientCacheFactoryToPdxConfigurerAdapter |
CacheFactoryBean.CacheFactoryToPdxConfigurerAdapter, CacheFactoryBean.JndiDataSource
AbstractBasicCacheFactoryBean.CacheFactoryInitializer<T>, AbstractBasicCacheFactoryBean.PdxConfigurer<T>
Modifier and Type | Field and Description |
---|---|
protected static PoolResolver |
DEFAULT_POOL_RESOLVER |
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
before the ClientCache is created. |
protected void |
applyClientCacheConfigurers(ClientCacheConfigurer... clientCacheConfigurers)
Applies the array of
ClientCacheConfigurers to this ClientCacheFactoryBean
before the ClientCache is created. |
protected void |
applyClientCacheConfigurers(Iterable<ClientCacheConfigurer> clientCacheConfigurers)
Apples the
Iterable of ClientCacheConfigurers
to this ClientCacheFactoryBean before the ClientCache is created. |
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 org.apache.geode.cache.client.ClientCacheFactory |
configurePdx(org.apache.geode.cache.client.ClientCacheFactory clientCacheFactory)
Configures the
ClientCache to use PDX serialization. |
protected org.apache.geode.cache.client.ClientCacheFactory |
configurePool(org.apache.geode.cache.client.ClientCacheFactory clientCacheFactory)
Configure the DEFAULT
Pool of the ClientCacheFactory using a given Pool
instance or a named Pool instance. |
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 Apache Geode Properties
used to construct, configure and initialize a new ClientCache instance. |
protected <T extends org.apache.geode.cache.GemFireCache> |
doFetchCache()
Fetches an existing
ClientCache instance from the ClientCacheFactory . |
protected Class<? extends org.apache.geode.cache.GemFireCache> |
doGetObjectType()
|
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 GemFire System property 'durable-client-id' indicating to the server whether
this client is durable.
|
Integer |
getDurableClientTimeout()
Get the value of the 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() |
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. |
PoolResolver |
getPoolResolver()
|
Boolean |
getPrSingleHopEnabled() |
Integer |
getReadTimeout() |
Boolean |
getReadyForEvents()
Gets the user-configured value for deciding that this client is ready to receive events from the server(s).
|
Integer |
getRetryAttempts() |
Integer |
getServerConnectionTimeout() |
String |
getServerGroup() |
protected ConnectionEndpointList |
getServers() |
Integer |
getSocketBufferSize() |
Integer |
getSocketConnectTimeout() |
org.apache.geode.cache.client.SocketFactory |
getSocketFactory() |
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 GemFire cache client is ready for events.
|
void |
onApplicationEvent(ContextRefreshedEvent event)
Inform the Apache Geode cluster that this
ClientCache is ready to receive events
iff the client is non-durable. |
protected org.apache.geode.cache.client.Pool |
resolvePool()
Resolves the
Pool used to configure the ClientCache , DEFAULT Pool . |
protected Properties |
resolveProperties()
Resolves the 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> clientCacheConfigurers)
Null-safe operation to set an
List of ClientCacheConfigurers to apply
additional configuration to this ClientCacheFactoryBean when using Annotation-based configuration. |
void |
setDurableClientId(String durableClientId)
Set the GemFire System property 'durable-client-id' to indicate to the server that this client is durable.
|
void |
setDurableClientTimeout(Integer durableClientTimeout)
Set the 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 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 |
setServerConnectionTimeout(Integer serverConnectionTimeout) |
void |
setServerGroup(String serverGroup) |
void |
setServers(ConnectionEndpoint[] servers) |
void |
setServers(Iterable<ConnectionEndpoint> servers) |
void |
setSocketBufferSize(Integer socketBufferSize) |
void |
setSocketConnectTimeout(Integer socketConnectTimeout) |
void |
setSocketFactory(org.apache.geode.cache.client.SocketFactory socketFactory) |
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.
|
applyPeerCacheConfigurers, applyPeerCacheConfigurers, configurePdx, configureSecurity, getCompositePeerCacheConfigurer, getGatewayConflictResolver, getJndiDataSources, getLockLease, getLockTimeout, getMessageSyncInterval, getSearchTimeout, getSecurityManager, postProcess, setGatewayConflictResolver, setJndiDataSources, setLockLease, setLockTimeout, setMessageSyncInterval, setPeerCacheConfigurers, setPeerCacheConfigurers, setSearchTimeout, setSecurityManager
doGetObject, init, initializeFactory, postProcess, resolveCache
afterPropertiesSet, destroy, getBeanFactoryLocator, getCacheXml, getOptionalBeanFactoryLocator, getOptionalCacheXml, getProperties, isCacheXmlPresent, isCacheXmlResolvableAsAFile, isUseBeanFactoryLocator, loadCacheXml, setAndGetProperties, setBeanFactoryLocator, setCacheXml, setProperties, setUseBeanFactoryLocator
configureHeapPercentages, configureOffHeapPercentages, configurePdx, fetchCache, getCache, getCacheFactoryInitializer, getCopyOnRead, getCriticalHeapPercentage, getCriticalOffHeapPercentage, getEvictionHeapPercentage, getEvictionOffHeapPercentage, getObject, getObjectType, getOptionalCache, getPdxDiskStoreName, getPdxIgnoreUnreadFields, getPdxPersistent, getPdxReadSerialized, getPdxSerializer, getPhase, getTransactionListeners, getTransactionWriter, isClose, isCopyOnRead, isNotClosed, registerTransactionListeners, registerTransactionWriter, setCache, setCacheFactoryInitializer, setClose, setCopyOnRead, setCriticalHeapPercentage, setCriticalOffHeapPercentage, setEvictionHeapPercentage, setEvictionOffHeapPercentage, setPdxDiskStoreName, setPdxIgnoreUnreadFields, setPdxPersistent, setPdxReadSerialized, setPdxSerializer, setPhase, setTransactionListeners, setTransactionWriter, translateExceptionIfPossible
getBeanClassLoader, getBeanFactory, getBeanName, getLogger, getOptionalLogger, isDebugLoggingEnabled, isErrorLoggingEnabled, isInfoLoggingEnabled, isSingleton, isWarnLoggingEnabled, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, newLogger, setBeanClassLoader, setBeanFactory, setBeanName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forPayload
protected static final PoolResolver DEFAULT_POOL_RESOLVER
protected void applyCacheConfigurers()
ClientCacheConfigurers
to this ClientCacheFactoryBean
before the ClientCache
is created.applyCacheConfigurers
in class CacheFactoryBean
getCompositeClientCacheConfigurer()
,
applyClientCacheConfigurers(ClientCacheConfigurer...)
protected void applyClientCacheConfigurers(ClientCacheConfigurer... clientCacheConfigurers)
ClientCacheConfigurers
to this ClientCacheFactoryBean
before the ClientCache
is created.clientCacheConfigurers
- array of ClientCacheConfigurers
applied to this ClientCacheFactoryBean
.ClientCacheConfigurer
,
applyClientCacheConfigurers(Iterable)
protected void applyClientCacheConfigurers(Iterable<ClientCacheConfigurer> clientCacheConfigurers)
Iterable
of ClientCacheConfigurers
to this ClientCacheFactoryBean
before the ClientCache
is created.clientCacheConfigurers
- Iterable
of ClientCacheConfigurers
applied to this ClientCacheFactoryBean
.ClientCacheConfigurer
,
Iterable
protected <T extends org.apache.geode.cache.GemFireCache> T doFetchCache()
ClientCache
instance from the ClientCacheFactory
.doFetchCache
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
,
AbstractBasicCacheFactoryBean.getCache()
protected Class<? extends org.apache.geode.cache.GemFireCache> doGetObjectType()
type
of GemFireCache
constructed by this ClientCacheFactoryBean
.
Returns ClientCache
Class
.doGetObjectType
in class CacheFactoryBean
type
of GemFireCache
constructed by this ClientCacheFactoryBean
.FactoryBean.getObjectType()
@NonNull protected Properties resolveProperties()
Properties
used to configure the ClientCache
.resolveProperties
in class AbstractConfigurableCacheFactoryBean
Properties
used to configure the ClientCache
.DistributedSystem.getProperties()
@NonNull protected Object createFactory(@NonNull Properties gemfireProperties)
ClientCacheFactory
initialized with the given Apache Geode Properties
used to construct, configure and initialize a new ClientCache
instance.createFactory
in class CacheFactoryBean
gemfireProperties
- Properties
used by the ClientCacheFactory
to configure the ClientCache
.ClientCacheFactory
initialized with the given Apache Geode Properties
.ClientCacheFactory
,
Properties
@NonNull protected Object configureFactory(@NonNull Object factory)
ClientCacheFactory
used to create the ClientCache
.configureFactory
in class CacheFactoryBean
factory
- ClientCacheFactory
used to create the ClientCache
.ClientCacheFactory
.ClientCacheFactory
,
configurePool(ClientCacheFactory)
,
AbstractBasicCacheFactoryBean.configurePdx(PdxConfigurer)
@NonNull protected org.apache.geode.cache.client.ClientCacheFactory configurePdx(@NonNull org.apache.geode.cache.client.ClientCacheFactory clientCacheFactory)
ClientCache
to use PDX serialization.clientCacheFactory
- ClientCacheFactory
to configure with PDX.ClientCacheFactory
.ClientCacheFactoryBean.ClientCacheFactoryToPdxConfigurerAdapter
,
ClientCacheFactory
,
AbstractBasicCacheFactoryBean.configurePdx(PdxConfigurer)
@NonNull protected org.apache.geode.cache.client.ClientCacheFactory configurePool(@NonNull org.apache.geode.cache.client.ClientCacheFactory clientCacheFactory)
Pool
of the ClientCacheFactory
using a given Pool
instance or a named Pool
instance.clientCacheFactory
- ClientCacheFactory
used to configure the DEFAULT Pool
.ClientCacheFactory
,
Pool
@Nullable protected org.apache.geode.cache.client.Pool resolvePool()
Pool
used to configure the ClientCache
, DEFAULT Pool
.Pool
used to configure the ClientCache
, DEFAULT Pool
.PoolManager.find(String)
,
Pool
,
getPoolName()
,
getPool()
,
findPool(String)
,
isPoolNameResolvable(String)
@NonNull protected <T extends org.apache.geode.cache.GemFireCache> T createCache(@NonNull Object factory)
ClientCache
instance using the provided factory
.createCache
in class CacheFactoryBean
T
- parameterized Class
type extending GemFireCache
.factory
- instance of ClientCacheFactory
.ClientCache
created by the provided factory.ClientCacheFactory.create()
,
ClientCache
,
GemFireCache
public void onApplicationEvent(@NonNull ContextRefreshedEvent event)
ClientCache
is ready to receive events
iff the client is non-durable.onApplicationEvent
in interface ApplicationListener<ContextRefreshedEvent>
event
- ApplicationContextEvent
fired when the ApplicationContext
is refreshed.ClientCache.readyForEvents()
,
isReadyForEvents()
,
AbstractBasicCacheFactoryBean.fetchCache()
protected void close(@NonNull org.apache.geode.cache.GemFireCache cache)
ClientCache
and preserve durability.close
in class AbstractBasicCacheFactoryBean
cache
- GemFireCache
to close.ClientCache.close(boolean)
,
isKeepAlive()
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> clientCacheConfigurers)
List
of ClientCacheConfigurers
to apply
additional configuration to this ClientCacheFactoryBean
when using Annotation-based configuration.clientCacheConfigurers
- List
of ClientCacheConfigurers
used to
apply additional configuration to this ClientCacheFactoryBean
.ClientCacheConfigurer
,
setClientCacheConfigurers(ClientCacheConfigurer...)
@NonNull 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(@Nullable 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
@Nullable 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(@Nullable 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.@Nullable 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 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()
Boolean
indicating whether this client is ready to receive events from the server(s).public boolean isReadyForEvents()
CacheUtils.isDurable(ClientCache)
,
getReadyForEvents()
public void setRetryAttempts(Integer retryAttempts)
public Integer getRetryAttempts()
public void setServerConnectionTimeout(Integer serverConnectionTimeout)
public Integer getServerConnectionTimeout()
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 setSocketFactory(@Nullable org.apache.geode.cache.client.SocketFactory socketFactory)
@NonNull public org.apache.geode.cache.client.SocketFactory getSocketFactory()
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–2023 Pivotal Software, Inc.. All rights reserved.