Spring Data for VMware GemFire
Class PoolFactoryBean
java.lang.Object
org.springframework.data.gemfire.support.AbstractFactoryBeanSupport<org.apache.geode.cache.client.Pool>
org.springframework.data.gemfire.client.PoolFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<org.apache.geode.cache.client.Pool>,org.springframework.beans.factory.InitializingBean
public class PoolFactoryBean
extends AbstractFactoryBeanSupport<org.apache.geode.cache.client.Pool>
implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean
Spring
FactoryBean used to construct, configure and initialize a Pool.
If a new Pool is created, its lifecycle is bound to that of this declaring FactoryBean
and indirectly, the Spring container.
If a Pool having the configured name already exists, then the existing Pool
will be returned as is without any modifications and its lifecycle will be unaffected by this FactoryBean.- See Also:
-
InetSocketAddressClientCachePoolPoolFactoryPoolManagerDistributedSystemDisposableBeanInitializingBeanPoolResolverPoolConfigurerAbstractFactoryBeanSupportConnectionEndpointConnectionEndpointList
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCallback interface to initialize thePoolFactoryused by thisPoolFactoryBeanto create aPoolby providing additional or alternative configuration for the factory. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final PoolResolverprotected static final intFields inherited from class org.springframework.data.gemfire.support.AbstractFactoryBeanSupport
DEFAULT_SINGLETONFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLocators(Iterable<ConnectionEndpoint> locators) voidaddLocators(ConnectionEndpoint... locators) voidaddServers(Iterable<ConnectionEndpoint> servers) voidaddServers(ConnectionEndpoint... servers) voidPrepares the construction, configuration and initialization of a newPool.protected voidapplyPoolConfigurers(Iterable<PoolConfigurer> poolConfigurers) protected voidapplyPoolConfigurers(PoolConfigurer... poolConfigurers) Null-safe operation to apply the given array ofPoolConfigurersto thisPoolFactoryBean.protected org.apache.geode.cache.client.PoolFactoryconfigure(org.apache.geode.cache.client.PoolFactory poolFactory) Configures the givenPoolFactoryfrom thisPoolFactoryBean.protected org.apache.geode.cache.client.PoolDeprecated.protected org.apache.geode.cache.client.PoolcreatePool(org.apache.geode.cache.client.PoolFactory poolFactory, String poolName) protected org.apache.geode.cache.client.PoolFactoryCreates an instance of thePoolFactoryinterface to construct, configure and initialize aPool.voiddestroy()Releases all system resources and destroys thePoolwhen created by thisPoolFactoryBean.protected PoolConfigurerReturns a reference to the CompositePoolConfigurerused to apply additional configuration to thisPoolFactoryBeanon Spring container initialization.protected StringgetName()Gets the configurednameof thePoolbean.org.apache.geode.cache.client.PoolReturns an object reference to thePoolcreated by thisPoolFactoryBean.Class<?>org.apache.geode.cache.client.PoolgetPool()Gets thePoolconfigured and built by thisPoolFactoryBean.protected org.apache.geode.cache.client.SocketFactoryprotected org.apache.geode.cache.client.PoolFactoryinitialize(org.apache.geode.cache.client.PoolFactory poolFactory) Initializes the givenPoolFactorywith any configuredPoolFactoryBean.PoolFactoryInitializer.protected org.apache.geode.cache.client.PoolpostProcess(org.apache.geode.cache.client.Pool pool) Post processes thePoolcreated by thisPoolFactoryBean.protected org.apache.geode.cache.client.PoolFactorypostProcess(org.apache.geode.cache.client.PoolFactory poolFactory) Post processes the fully configuredPoolFactory.voidsetFreeConnectionTimeout(int freeConnectionTimeout) voidsetIdleTimeout(long idleTimeout) voidsetKeepAlive(boolean keepAlive) voidsetLoadConditioningInterval(int loadConditioningInterval) voidsetLocators(Iterable<ConnectionEndpoint> locators) voidsetLocators(ConnectionEndpoint[] locators) voidsetMaxConnections(int maxConnections) voidsetMinConnections(int minConnections) voidsetMultiUserAuthentication(boolean multiUserAuthentication) voidConfigures thenameof thePoolbean.voidsetPingInterval(long pingInterval) voidsetPool(org.apache.geode.cache.client.Pool pool) Configures thePoolto be returned by thisPoolFactoryBean.voidsetPoolConfigurers(List<PoolConfigurer> poolConfigurers) Null-safe operation to set anIterableofPoolConfigurersused to apply additional configuration to thisPoolFactoryBeanwhen using Annotation-based configuration.voidsetPoolConfigurers(PoolConfigurer... poolConfigurers) Null-safe operation to set an array ofPoolConfigurersused to apply additional configuration to thisPoolFactoryBeanwhen using Annotation-based configuration.voidsetPoolFactoryInitializer(PoolFactoryBean.PoolFactoryInitializer poolFactoryInitializer) Sets thePoolFactoryBean.PoolFactoryInitializerto initialize thePoolFactoryused by thisPoolFactoryBeanto create aPool.voidsetPoolResolver(PoolResolver poolResolver) voidsetPrSingleHopEnabled(boolean prSingleHopEnabled) voidsetReadTimeout(int readTimeout) voidsetRetryAttempts(int retryAttempts) voidsetServerConnectionTimeout(int serverConnectionTimeout) voidsetServerGroup(String serverGroup) voidsetServers(Iterable<ConnectionEndpoint> servers) voidsetServers(ConnectionEndpoint[] servers) voidsetSocketBufferSize(int socketBufferSize) voidsetSocketConnectTimeout(int socketConnectTimeout) voidsetSocketFactory(org.apache.geode.cache.client.SocketFactory socketFactory) voidsetStatisticInterval(int statisticInterval) voidsetSubscriptionAckInterval(int subscriptionAckInterval) voidsetSubscriptionEnabled(boolean subscriptionEnabled) voidsetSubscriptionMessageTrackingTimeout(int subscriptionMessageTrackingTimeout) voidsetSubscriptionRedundancy(int subscriptionRedundancy) voidsetSubscriptionTimeoutMultiplier(int subscriptionTimeoutMultiplier) voidsetXmlDeclaredLocators(ConnectionEndpointList xmlDeclaredLocators) voidsetXmlDeclaredServers(ConnectionEndpointList xmlDeclaredServers) Methods inherited from class org.springframework.data.gemfire.support.AbstractFactoryBeanSupport
getBeanClassLoader, getBeanFactory, getBeanName, getLogger, getOptionalLogger, isDebugLoggingEnabled, isErrorLoggingEnabled, isInfoLoggingEnabled, isSingleton, isWarnLoggingEnabled, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, newLogger, setBeanClassLoader, setBeanFactory, setBeanName
-
Field Details
-
DEFAULT_LOCATOR_PORT
protected static final int DEFAULT_LOCATOR_PORT- See Also:
-
DEFAULT_SERVER_PORT
protected static final int DEFAULT_SERVER_PORT- See Also:
-
DEFAULT_POOL_RESOLVER
-
-
Constructor Details
-
PoolFactoryBean
public PoolFactoryBean()
-
-
Method Details
-
afterPropertiesSet
Prepares the construction, configuration and initialization of a newPool.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception- ifPoolinitialization fails.- See Also:
-
PoolManagerPoolFactoryPool
-
applyPoolConfigurers
Null-safe operation to apply the given array ofPoolConfigurersto thisPoolFactoryBean.- Parameters:
poolConfigurers- array ofPoolConfigurersapplied to thisPoolFactoryBean.- See Also:
-
applyPoolConfigurers
- Parameters:
poolConfigurers-IterableofPoolConfigurersapplied to thisPoolFactoryBean.- See Also:
-
destroy
public void destroy()Releases all system resources and destroys thePoolwhen created by thisPoolFactoryBean.- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- See Also:
-
DisposableBean.destroy()
-
getObject
Returns an object reference to thePoolcreated by thisPoolFactoryBean.- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<org.apache.geode.cache.client.Pool>- Returns:
- an object reference to the
Poolcreated by thisPoolFactoryBean. - Throws:
Exception- See Also:
-
FactoryBean.getObject()Pool
-
createPoolFactory
protected org.apache.geode.cache.client.PoolFactory createPoolFactory()Creates an instance of thePoolFactoryinterface to construct, configure and initialize aPool.- Returns:
- a
PoolFactoryimplementation to create aPool. - See Also:
-
PoolManager.createFactory()PoolFactory
-
configure
protected org.apache.geode.cache.client.PoolFactory configure(org.apache.geode.cache.client.PoolFactory poolFactory) Configures the givenPoolFactoryfrom thisPoolFactoryBean.- Parameters:
poolFactory-PoolFactoryto configure.- Returns:
- the given
PoolFactory. - See Also:
-
PoolFactory
-
initialize
protected org.apache.geode.cache.client.PoolFactory initialize(org.apache.geode.cache.client.PoolFactory poolFactory) Initializes the givenPoolFactorywith any configuredPoolFactoryBean.PoolFactoryInitializer.- Parameters:
poolFactory-PoolFactoryto initialize.- Returns:
- the initialized
PoolFactory. - See Also:
-
PoolFactory
-
postProcess
protected org.apache.geode.cache.client.PoolFactory postProcess(org.apache.geode.cache.client.PoolFactory poolFactory) Post processes the fully configuredPoolFactory.- Parameters:
poolFactory-PoolFactoryto post process.- Returns:
- the post processed
PoolFactory. - See Also:
-
PoolFactory
-
create
@Deprecated protected org.apache.geode.cache.client.Pool create(org.apache.geode.cache.client.PoolFactory poolFactory, String poolName) Deprecated.UsecreatePool(PoolFactory, String)instead. -
createPool
protected org.apache.geode.cache.client.Pool createPool(org.apache.geode.cache.client.PoolFactory poolFactory, String poolName) -
postProcess
protected org.apache.geode.cache.client.Pool postProcess(org.apache.geode.cache.client.Pool pool) Post processes thePoolcreated by thisPoolFactoryBean.- Parameters:
pool-Poolto post process.- Returns:
- the post processed
Pool. - See Also:
-
Pool
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<org.apache.geode.cache.client.Pool>- Returns:
- the
typeofPoolproduced by thisPoolFactoryBean. - See Also:
-
FactoryBean.getObjectType()PoolClass
-
addLocators
-
addLocators
-
addServers
-
addServers
-
getCompositePoolConfigurer
Returns a reference to the CompositePoolConfigurerused to apply additional configuration to thisPoolFactoryBeanon Spring container initialization.- Returns:
- the Composite
PoolConfigurer. - See Also:
-
setName
Configures thenameof thePoolbean. -
getName
Gets the configurednameof thePoolbean.- Returns:
- the configured
nameof thePoolbean. - See Also:
-
setPool
public void setPool(@Nullable org.apache.geode.cache.client.Pool pool) Configures thePoolto be returned by thisPoolFactoryBean.- Parameters:
pool- thePoolto be returned by thisPoolFactoryBean.- See Also:
-
Pool
-
getPool
@NonNull public org.apache.geode.cache.client.Pool getPool()Gets thePoolconfigured and built by thisPoolFactoryBean. May return a proxyPoolif the actualPoolhas not yet been configured and built by thisPoolFactoryBean. In this case, the proxyPoolobject will have the same configuration as the finalPoolbuilt by thisPoolFactoryBean.- Returns:
- the
Poolconfigured and built by thisPoolFactoryBean. - See Also:
-
PoolsetPool(Pool)
-
setFreeConnectionTimeout
public void setFreeConnectionTimeout(int freeConnectionTimeout) -
setIdleTimeout
public void setIdleTimeout(long idleTimeout) -
setKeepAlive
public void setKeepAlive(boolean keepAlive) -
setLoadConditioningInterval
public void setLoadConditioningInterval(int loadConditioningInterval) -
setLocators
-
setLocators
-
setMaxConnections
public void setMaxConnections(int maxConnections) -
setMinConnections
public void setMinConnections(int minConnections) -
setMultiUserAuthentication
public void setMultiUserAuthentication(boolean multiUserAuthentication) -
setPingInterval
public void setPingInterval(long pingInterval) -
setPoolConfigurers
Null-safe operation to set an array ofPoolConfigurersused to apply additional configuration to thisPoolFactoryBeanwhen using Annotation-based configuration.- Parameters:
poolConfigurers- array ofPoolConfigurersused to apply additional configuration to thisPoolFactoryBean.- See Also:
-
setPoolConfigurers
Null-safe operation to set anIterableofPoolConfigurersused to apply additional configuration to thisPoolFactoryBeanwhen using Annotation-based configuration.- Parameters:
poolConfigurers-IterableofPoolConfigurersused to apply additional configuration to thisPoolFactoryBean.- See Also:
-
setPoolFactoryInitializer
public void setPoolFactoryInitializer(PoolFactoryBean.PoolFactoryInitializer poolFactoryInitializer) Sets thePoolFactoryBean.PoolFactoryInitializerto initialize thePoolFactoryused by thisPoolFactoryBeanto create aPool.- Parameters:
poolFactoryInitializer-PoolFactoryBean.PoolFactoryInitializeruser provided callback interface invoked by thisPoolFactoryBeanto initialize thePoolFactoryconstructed to create thePool.- See Also:
-
setPoolResolver
- Parameters:
poolResolver- the configuredPoolResolverused to resolvePoolobjects byname.- See Also:
-
getPoolResolver
- Returns:
- the configured
PoolResolver. - See Also:
-
setPrSingleHopEnabled
public void setPrSingleHopEnabled(boolean prSingleHopEnabled) -
setReadTimeout
public void setReadTimeout(int readTimeout) -
setRetryAttempts
public void setRetryAttempts(int retryAttempts) -
setServerConnectionTimeout
public void setServerConnectionTimeout(int serverConnectionTimeout) -
setServerGroup
-
setServers
-
setServers
-
setSocketBufferSize
public void setSocketBufferSize(int socketBufferSize) -
setSocketConnectTimeout
public void setSocketConnectTimeout(int socketConnectTimeout) -
setSocketFactory
public void setSocketFactory(org.apache.geode.cache.client.SocketFactory socketFactory) -
getSocketFactory
protected org.apache.geode.cache.client.SocketFactory getSocketFactory() -
setStatisticInterval
public void setStatisticInterval(int statisticInterval) -
setSubscriptionAckInterval
public void setSubscriptionAckInterval(int subscriptionAckInterval) -
setSubscriptionEnabled
public void setSubscriptionEnabled(boolean subscriptionEnabled) -
setSubscriptionMessageTrackingTimeout
public void setSubscriptionMessageTrackingTimeout(int subscriptionMessageTrackingTimeout) -
setSubscriptionRedundancy
public void setSubscriptionRedundancy(int subscriptionRedundancy) -
setSubscriptionTimeoutMultiplier
public void setSubscriptionTimeoutMultiplier(int subscriptionTimeoutMultiplier) -
setXmlDeclaredLocators
-
setXmlDeclaredServers
-
createPool(PoolFactory, String)instead.