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:
-
InetSocketAddress
ClientCache
Pool
PoolFactory
PoolManager
DistributedSystem
DisposableBean
InitializingBean
PoolResolver
PoolConfigurer
AbstractFactoryBeanSupport
ConnectionEndpoint
ConnectionEndpointList
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Callback interface to initialize thePoolFactory
used by thisPoolFactoryBean
to create aPool
by providing additional or alternative configuration for the factory. -
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
protected static final PoolResolver
protected static final int
Fields inherited from class org.springframework.data.gemfire.support.AbstractFactoryBeanSupport
DEFAULT_SINGLETON
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLocators
(Iterable<ConnectionEndpoint> locators) void
addLocators
(ConnectionEndpoint... locators) void
addServers
(Iterable<ConnectionEndpoint> servers) void
addServers
(ConnectionEndpoint... servers) void
Prepares the construction, configuration and initialization of a newPool
.protected void
applyPoolConfigurers
(Iterable<PoolConfigurer> poolConfigurers) protected void
applyPoolConfigurers
(PoolConfigurer... poolConfigurers) Null-safe operation to apply the given array ofPoolConfigurers
to thisPoolFactoryBean
.protected org.apache.geode.cache.client.PoolFactory
configure
(org.apache.geode.cache.client.PoolFactory poolFactory) Configures the givenPoolFactory
from thisPoolFactoryBean
.protected org.apache.geode.cache.client.Pool
Deprecated.protected org.apache.geode.cache.client.Pool
createPool
(org.apache.geode.cache.client.PoolFactory poolFactory, String poolName) protected org.apache.geode.cache.client.PoolFactory
Creates an instance of thePoolFactory
interface to construct, configure and initialize aPool
.void
destroy()
Releases all system resources and destroys thePool
when created by thisPoolFactoryBean
.protected PoolConfigurer
Returns a reference to the CompositePoolConfigurer
used to apply additional configuration to thisPoolFactoryBean
on Spring container initialization.protected String
getName()
Gets the configuredname
of thePool
bean.org.apache.geode.cache.client.Pool
Returns an object reference to thePool
created by thisPoolFactoryBean
.Class<?>
org.apache.geode.cache.client.Pool
getPool()
Gets thePool
configured and built by thisPoolFactoryBean
.protected org.apache.geode.cache.client.SocketFactory
protected org.apache.geode.cache.client.PoolFactory
initialize
(org.apache.geode.cache.client.PoolFactory poolFactory) Initializes the givenPoolFactory
with any configuredPoolFactoryBean.PoolFactoryInitializer
.protected org.apache.geode.cache.client.Pool
postProcess
(org.apache.geode.cache.client.Pool pool) Post processes thePool
created by thisPoolFactoryBean
.protected org.apache.geode.cache.client.PoolFactory
postProcess
(org.apache.geode.cache.client.PoolFactory poolFactory) Post processes the fully configuredPoolFactory
.void
setFreeConnectionTimeout
(int freeConnectionTimeout) void
setIdleTimeout
(long idleTimeout) void
setKeepAlive
(boolean keepAlive) void
setLoadConditioningInterval
(int loadConditioningInterval) void
setLocators
(Iterable<ConnectionEndpoint> locators) void
setLocators
(ConnectionEndpoint[] locators) void
setMaxConnections
(int maxConnections) void
setMinConnections
(int minConnections) void
setMultiUserAuthentication
(boolean multiUserAuthentication) void
Configures thename
of thePool
bean.void
setPingInterval
(long pingInterval) void
setPool
(org.apache.geode.cache.client.Pool pool) Configures thePool
to be returned by thisPoolFactoryBean
.void
setPoolConfigurers
(List<PoolConfigurer> poolConfigurers) Null-safe operation to set anIterable
ofPoolConfigurers
used to apply additional configuration to thisPoolFactoryBean
when using Annotation-based configuration.void
setPoolConfigurers
(PoolConfigurer... poolConfigurers) Null-safe operation to set an array ofPoolConfigurers
used to apply additional configuration to thisPoolFactoryBean
when using Annotation-based configuration.void
setPoolFactoryInitializer
(PoolFactoryBean.PoolFactoryInitializer poolFactoryInitializer) Sets thePoolFactoryBean.PoolFactoryInitializer
to initialize thePoolFactory
used by thisPoolFactoryBean
to create aPool
.void
setPoolResolver
(PoolResolver poolResolver) void
setPrSingleHopEnabled
(boolean prSingleHopEnabled) void
setReadTimeout
(int readTimeout) void
setRetryAttempts
(int retryAttempts) void
setServerConnectionTimeout
(int serverConnectionTimeout) void
setServerGroup
(String serverGroup) void
setServers
(Iterable<ConnectionEndpoint> servers) void
setServers
(ConnectionEndpoint[] servers) void
setSocketBufferSize
(int socketBufferSize) void
setSocketConnectTimeout
(int socketConnectTimeout) void
setSocketFactory
(org.apache.geode.cache.client.SocketFactory socketFactory) void
setStatisticInterval
(int statisticInterval) void
setSubscriptionAckInterval
(int subscriptionAckInterval) void
setSubscriptionEnabled
(boolean subscriptionEnabled) void
setSubscriptionMessageTrackingTimeout
(int subscriptionMessageTrackingTimeout) void
setSubscriptionRedundancy
(int subscriptionRedundancy) void
setSubscriptionTimeoutMultiplier
(int subscriptionTimeoutMultiplier) void
setThreadLocalConnections
(boolean threadLocalConnections) Deprecated.void
setXmlDeclaredLocators
(ConnectionEndpointList xmlDeclaredLocators) void
setXmlDeclaredServers
(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:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
- ifPool
initialization fails.- See Also:
-
PoolManager
PoolFactory
Pool
-
applyPoolConfigurers
Null-safe operation to apply the given array ofPoolConfigurers
to thisPoolFactoryBean
.- Parameters:
poolConfigurers
- array ofPoolConfigurers
applied to thisPoolFactoryBean
.- See Also:
-
applyPoolConfigurers
- Parameters:
poolConfigurers
-Iterable
ofPoolConfigurers
applied to thisPoolFactoryBean
.- See Also:
-
destroy
public void destroy()Releases all system resources and destroys thePool
when created by thisPoolFactoryBean
.- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- See Also:
-
DisposableBean.destroy()
-
getObject
Returns an object reference to thePool
created by thisPoolFactoryBean
.- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<org.apache.geode.cache.client.Pool>
- Returns:
- an object reference to the
Pool
created by thisPoolFactoryBean
. - Throws:
Exception
- See Also:
-
FactoryBean.getObject()
Pool
-
createPoolFactory
protected org.apache.geode.cache.client.PoolFactory createPoolFactory()Creates an instance of thePoolFactory
interface to construct, configure and initialize aPool
.- Returns:
- a
PoolFactory
implementation 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 givenPoolFactory
from thisPoolFactoryBean
.- Parameters:
poolFactory
-PoolFactory
to 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 givenPoolFactory
with any configuredPoolFactoryBean.PoolFactoryInitializer
.- Parameters:
poolFactory
-PoolFactory
to 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
-PoolFactory
to 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 thePool
created by thisPoolFactoryBean
.- Parameters:
pool
-Pool
to post process.- Returns:
- the post processed
Pool
. - See Also:
-
Pool
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<org.apache.geode.cache.client.Pool>
- Returns:
- the
type
ofPool
produced by thisPoolFactoryBean
. - See Also:
-
FactoryBean.getObjectType()
Pool
Class
-
addLocators
-
addLocators
-
addServers
-
addServers
-
getCompositePoolConfigurer
Returns a reference to the CompositePoolConfigurer
used to apply additional configuration to thisPoolFactoryBean
on Spring container initialization.- Returns:
- the Composite
PoolConfigurer
. - See Also:
-
setName
Configures thename
of thePool
bean. -
getName
Gets the configuredname
of thePool
bean.- Returns:
- the configured
name
of thePool
bean. - See Also:
-
setPool
public void setPool(@Nullable org.apache.geode.cache.client.Pool pool) Configures thePool
to be returned by thisPoolFactoryBean
.- Parameters:
pool
- thePool
to be returned by thisPoolFactoryBean
.- See Also:
-
Pool
-
getPool
@NonNull public org.apache.geode.cache.client.Pool getPool()Gets thePool
configured and built by thisPoolFactoryBean
. May return a proxyPool
if the actualPool
has not yet been configured and built by thisPoolFactoryBean
. In this case, the proxyPool
object will have the same configuration as the finalPool
built by thisPoolFactoryBean
.- Returns:
- the
Pool
configured and built by thisPoolFactoryBean
. - See Also:
-
Pool
setPool(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 ofPoolConfigurers
used to apply additional configuration to thisPoolFactoryBean
when using Annotation-based configuration.- Parameters:
poolConfigurers
- array ofPoolConfigurers
used to apply additional configuration to thisPoolFactoryBean
.- See Also:
-
setPoolConfigurers
Null-safe operation to set anIterable
ofPoolConfigurers
used to apply additional configuration to thisPoolFactoryBean
when using Annotation-based configuration.- Parameters:
poolConfigurers
-Iterable
ofPoolConfigurers
used to apply additional configuration to thisPoolFactoryBean
.- See Also:
-
setPoolFactoryInitializer
public void setPoolFactoryInitializer(PoolFactoryBean.PoolFactoryInitializer poolFactoryInitializer) Sets thePoolFactoryBean.PoolFactoryInitializer
to initialize thePoolFactory
used by thisPoolFactoryBean
to create aPool
.- Parameters:
poolFactoryInitializer
-PoolFactoryBean.PoolFactoryInitializer
user provided callback interface invoked by thisPoolFactoryBean
to initialize thePoolFactory
constructed to create thePool
.- See Also:
-
setPoolResolver
- Parameters:
poolResolver
- the configuredPoolResolver
used to resolvePool
objects 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) -
setThreadLocalConnections
Deprecated. -
setXmlDeclaredLocators
-
setXmlDeclaredServers
-
createPool(PoolFactory, String)
instead.