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
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 PoolFactory
configure
(PoolFactory poolFactory) Configures the givenPoolFactory
from thisPoolFactoryBean
.protected Pool
create
(PoolFactory poolFactory, String poolName) Deprecated.protected Pool
createPool
(PoolFactory poolFactory, String poolName) protected 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()
Returns an object reference to thePool
created by thisPoolFactoryBean
.Class<?>
getPool()
Gets thePool
configured and built by thisPoolFactoryBean
.protected SocketFactory
protected PoolFactory
initialize
(PoolFactory poolFactory) Initializes the givenPoolFactory
with any configuredPoolFactoryBean.PoolFactoryInitializer
.protected Pool
postProcess
(Pool pool) Post processes thePool
created by thisPoolFactoryBean
.protected PoolFactory
postProcess
(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
void
setPingInterval
(long pingInterval) void
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
(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 interfaceInitializingBean
- Throws:
Exception
- ifPool
initialization fails.- See Also:
-
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 interfaceDisposableBean
- See Also:
-
getObject
Returns an object reference to thePool
created by thisPoolFactoryBean
.- Specified by:
getObject
in interfaceFactoryBean<Pool>
- Returns:
- an object reference to the
Pool
created by thisPoolFactoryBean
. - Throws:
Exception
- See Also:
-
createPoolFactory
Creates an instance of thePoolFactory
interface to construct, configure and initialize aPool
.- Returns:
- a
PoolFactory
implementation to create aPool
. - See Also:
-
configure
Configures the givenPoolFactory
from thisPoolFactoryBean
.- Parameters:
poolFactory
-PoolFactory
to configure.- Returns:
- the given
PoolFactory
. - See Also:
-
initialize
Initializes the givenPoolFactory
with any configuredPoolFactoryBean.PoolFactoryInitializer
.- Parameters:
poolFactory
-PoolFactory
to initialize.- Returns:
- the initialized
PoolFactory
. - See Also:
-
postProcess
Post processes the fully configuredPoolFactory
.- Parameters:
poolFactory
-PoolFactory
to post process.- Returns:
- the post processed
PoolFactory
. - See Also:
-
create
Deprecated.UsecreatePool(PoolFactory, String)
instead. -
createPool
-
postProcess
Post processes thePool
created by thisPoolFactoryBean
. -
getObjectType
- Specified by:
getObjectType
in interfaceFactoryBean<Pool>
- Returns:
- the
type
ofPool
produced by thisPoolFactoryBean
. - See Also:
-
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
-
getName
-
setPool
Configures thePool
to be returned by thisPoolFactoryBean
.- Parameters:
pool
- thePool
to be returned by thisPoolFactoryBean
.- See Also:
-
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:
-
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
-
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.