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.DynamicRegionSupport, CacheFactoryBean.JndiDataSource
beanFactoryLocator
DEFAULT_SINGLETON
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 |
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)
<<<<<<< HEAD
|
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 create 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 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() |
Class<? extends org.apache.geode.cache.GemFireCache> |
getObjectType()
<<<<<<< HEAD
|
Long |
getPingInterval() |
org.apache.geode.cache.client.Pool |
getPool()
Gets the
Pool used by this cache client to obtain connections to the GemFire cluster. |
String |
getPoolName()
Gets the name of the GemFire
Pool used by this GemFire cache client. |
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 |
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 Pivotal GemFire/Apache Geode cluster that this cache client is ready to receive events
iff the client is non-durable.
|
protected void |
postProcessBeforeCacheInitialization(Properties gemfireProperties)
Post processes this
ClientCacheFactoryBean before cache initialization. |
protected Object |
prepareFactory(Object factory)
Prepares and initializes the
ClientCacheFactory used to create the ClientCache . |
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 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 cache client to obtain connections to the GemFire cluster. |
void |
setPoolName(String poolName)
Sets the name of the
Pool used by this cache client to obtain connections to the GemFire cluster. |
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 |
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, getCacheXml, getCompositePeerCacheConfigurer, getCopyOnRead, getCriticalHeapPercentage, getDynamicRegionSupport, getEvictionHeapPercentage, getGatewayConflictResolver, getJndiDataSources, getLockLease, getLockTimeout, getMessageSyncInterval, getObject, getPdxDiskStoreName, getPdxIgnoreUnreadFields, getPdxPersistent, getPdxReadSerialized, getPdxSerializer, getPhase, getProperties, getSearchTimeout, getTransactionListeners, getTransactionWriter, isClose, isUseBeanFactoryLocator, postProcess, resolveCache, setAndGetProperties, setCache, setCacheXml, setClose, setCopyOnRead, setCriticalHeapPercentage, setDynamicRegionSupport, setEvictionHeapPercentage, setGatewayConflictResolver, setJndiDataSources, setLockLease, setLockTimeout, setMessageSyncInterval, setPdxDiskStoreName, setPdxIgnoreUnreadFields, setPdxPersistent, setPdxReadSerialized, setPdxSerializer, setPeerCacheConfigurers, setPeerCacheConfigurers, setPhase, setProperties, setSearchTimeout, setTransactionListeners, setTransactionWriter, setUseBeanFactoryLocator, translateExceptionIfPossible
getBeanClassLoader, getBeanFactory, getBeanName, getLog, isSingleton, logDebug, logDebug, logInfo, logInfo, newLog, setBeanClassLoader, setBeanFactory, setBeanName
protected void postProcessBeforeCacheInitialization(Properties gemfireProperties)
ClientCacheFactoryBean
before cache initialization.
This is also the point at which any configured ClientCacheConfigurer
beans are called.postProcessBeforeCacheInitialization
in class CacheFactoryBean
gemfireProperties
- Properties
used to configure Pivotal GemFire/Apache Geode.ClientCacheConfigurer
,
Properties
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 create 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 prepareFactory(Object factory)
ClientCacheFactory
used to create the ClientCache
.
Sets PDX options specified by the user.prepareFactory
in class CacheFactoryBean
factory
- ClientCacheFactory
used to create the ClientCache
.ClientCacheFactory
.initializePdx(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)
close
in class CacheFactoryBean
cache
- GemFireCache
to close.ClientCache.close(boolean)
,
>>>>>>> c22ebe6... DATAGEODE-12 - Introduce Spring Configurers to flexibly alter Spring Data GemFire configuration when using Annotation config.
public Class<? extends org.apache.geode.cache.GemFireCache> getObjectType()
getObjectType
in interface FactoryBean<org.apache.geode.cache.Cache>
getObjectType
in class CacheFactoryBean
Class
type of the GemFireCache
produced by this ClientCacheFactoryBean
.>>>>>>> c22ebe6... DATAGEODE-12 - Introduce Spring Configurers to flexibly alter Spring Data GemFire configuration when using Annotation config.
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 cache client to obtain connections to the GemFire cluster.pool
- the GemFire Pool
used by this ClientCache
to obtain connections
to the GemFire cluster.IllegalArgumentException
- if the Pool
is null.public org.apache.geode.cache.client.Pool getPool()
Pool
used by this cache client to obtain connections to the GemFire cluster.Pool
used by this ClientCache
to obtain connections
to the GemFire cluster.public void setPoolName(String poolName)
Pool
used by this cache client to obtain connections to the GemFire cluster.poolName
- set the name of the GemFire Pool
used by this GemFire ClientCache
.IllegalArgumentException
- if the Pool
name is unspecified.public String getPoolName()
Pool
used by this GemFire cache client.Pool
used by this GemFire cache client.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 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–2017 Pivotal Software, Inc.. All rights reserved.