Class PoolFactoryBean
java.lang.Object
org.springframework.data.gemfire.support.AbstractFactoryBeanSupport<Pool>
org.springframework.data.gemfire.client.PoolFactoryBean
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,BeanNameAware,DisposableBean,FactoryBean<Pool>,InitializingBean
public class PoolFactoryBean
extends AbstractFactoryBeanSupport<Pool>
implements DisposableBean, 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.- Author:
- Costin Leau, John Blum
- See Also:
-
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 PoolFactoryconfigure(PoolFactory poolFactory) Configures the givenPoolFactoryfrom thisPoolFactoryBean.protected Poolcreate(PoolFactory poolFactory, String poolName) Deprecated.protected PoolcreatePool(PoolFactory poolFactory, String poolName) protected 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()Returns an object reference to thePoolcreated by thisPoolFactoryBean.Class<?>getPool()Gets thePoolconfigured and built by thisPoolFactoryBean.protected SocketFactoryprotected PoolFactoryinitialize(PoolFactory poolFactory) Initializes the givenPoolFactorywith any configuredPoolFactoryBean.PoolFactoryInitializer.protected PoolpostProcess(Pool pool) Post processes thePoolcreated by thisPoolFactoryBean.protected PoolFactorypostProcess(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) voidvoidsetPingInterval(long pingInterval) voidConfigures 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(SocketFactory socketFactory) voidsetStatisticInterval(int statisticInterval) voidsetSubscriptionAckInterval(int subscriptionAckInterval) voidsetSubscriptionEnabled(boolean subscriptionEnabled) voidsetSubscriptionMessageTrackingTimeout(int subscriptionMessageTrackingTimeout) voidsetSubscriptionRedundancy(int subscriptionRedundancy) voidsetSubscriptionTimeoutMultiplier(int subscriptionTimeoutMultiplier) voidsetThreadLocalConnections(boolean threadLocalConnections) Deprecated.voidsetXmlDeclaredLocators(ConnectionEndpointList xmlDeclaredLocators) voidsetXmlDeclaredServers(ConnectionEndpointList xmlDeclaredServers) Methods inherited from class org.springframework.data.gemfire.support.AbstractFactoryBeanSupport
getBeanClassLoader, getBeanFactory, getBeanName, getLog, getOptionalLog, isDebugLoggingEnabled, isErrorLoggingEnabled, isInfoLoggingEnabled, isSingleton, isWarnLoggingEnabled, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, newLog, 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 interfaceInitializingBean- Throws:
Exception- ifPoolinitialization fails.- See Also:
-
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 interfaceDisposableBean- See Also:
-
getObject
Returns an object reference to thePoolcreated by thisPoolFactoryBean.- Specified by:
getObjectin interfaceFactoryBean<Pool>- Returns:
- an object reference to the
Poolcreated by thisPoolFactoryBean. - Throws:
Exception- See Also:
-
createPoolFactory
Creates an instance of thePoolFactoryinterface to construct, configure and initialize aPool.- Returns:
- a
PoolFactoryimplementation to create aPool. - See Also:
-
configure
Configures the givenPoolFactoryfrom thisPoolFactoryBean.- Parameters:
poolFactory-PoolFactoryto configure.- Returns:
- the given
PoolFactory. - See Also:
-
initialize
Initializes the givenPoolFactorywith any configuredPoolFactoryBean.PoolFactoryInitializer.- Parameters:
poolFactory-PoolFactoryto initialize.- Returns:
- the initialized
PoolFactory. - See Also:
-
postProcess
Post processes the fully configuredPoolFactory.- Parameters:
poolFactory-PoolFactoryto post process.- Returns:
- the post processed
PoolFactory. - See Also:
-
create
Deprecated.UsecreatePool(PoolFactory, String)instead. -
createPool
-
postProcess
Post processes thePoolcreated by thisPoolFactoryBean. -
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<Pool>- Returns:
- the
typeofPoolproduced by thisPoolFactoryBean. - See Also:
-
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
-
getName
-
setPool
Configures thePoolto be returned by thisPoolFactoryBean.- Parameters:
pool- thePoolto be returned by thisPoolFactoryBean.- See Also:
-
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:
-
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
-
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) -
setThreadLocalConnections
Deprecated. -
setXmlDeclaredLocators
-
setXmlDeclaredServers
-
createPool(PoolFactory, String)instead.