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:
  • 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

      protected static final PoolResolver DEFAULT_POOL_RESOLVER
  • Constructor Details

    • PoolFactoryBean

      public PoolFactoryBean()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Prepares the construction, configuration and initialization of a new Pool.
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception - if Pool initialization fails.
      See Also:
      • PoolManager
      • PoolFactory
      • Pool
    • applyPoolConfigurers

      protected void applyPoolConfigurers(PoolConfigurer... poolConfigurers)
      Null-safe operation to apply the given array of PoolConfigurers to this PoolFactoryBean.
      Parameters:
      poolConfigurers - array of PoolConfigurers applied to this PoolFactoryBean.
      See Also:
    • applyPoolConfigurers

      protected void applyPoolConfigurers(Iterable<PoolConfigurer> poolConfigurers)
      Null-safe operation to apply the given Iterable of PoolConfigurers to this PoolFactoryBean.
      Parameters:
      poolConfigurers - Iterable of PoolConfigurers applied to this PoolFactoryBean.
      See Also:
    • destroy

      public void destroy()
      Releases all system resources and destroys the Pool when created by this PoolFactoryBean.
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      See Also:
      • DisposableBean.destroy()
    • getObject

      public org.apache.geode.cache.client.Pool getObject() throws Exception
      Returns an object reference to the Pool created by this PoolFactoryBean.
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<org.apache.geode.cache.client.Pool>
      Returns:
      an object reference to the Pool created by this PoolFactoryBean.
      Throws:
      Exception
      See Also:
      • FactoryBean.getObject()
      • Pool
    • createPoolFactory

      protected org.apache.geode.cache.client.PoolFactory createPoolFactory()
      Creates an instance of the PoolFactory interface to construct, configure and initialize a Pool.
      Returns:
      a PoolFactory implementation to create a Pool.
      See Also:
      • PoolManager.createFactory()
      • PoolFactory
    • configure

      protected org.apache.geode.cache.client.PoolFactory configure(org.apache.geode.cache.client.PoolFactory poolFactory)
      Configures the given PoolFactory from this PoolFactoryBean.
      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 given PoolFactory with any configured PoolFactoryBean.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 configured PoolFactory.
      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.
    • createPool

      protected org.apache.geode.cache.client.Pool createPool(org.apache.geode.cache.client.PoolFactory poolFactory, String poolName)
      Creates a Pool with the given name using the provided PoolFactory.
      Parameters:
      poolFactory - PoolFactory used to create the Pool.
      poolName - name of the new Pool.
      Returns:
      a new instance of Pool with the given name.
      See Also:
      • PoolFactory.create(String)
      • Pool
    • postProcess

      protected org.apache.geode.cache.client.Pool postProcess(org.apache.geode.cache.client.Pool pool)
      Post processes the Pool created by this PoolFactoryBean.
      Parameters:
      pool - Pool to post process.
      Returns:
      the post processed Pool.
      See Also:
      • Pool
    • getObjectType

      public Class<?> getObjectType()
      Returns the type of Pool produced by this PoolFactoryBean.
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<org.apache.geode.cache.client.Pool>
      Returns:
      the type of Pool produced by this PoolFactoryBean.
      See Also:
      • FactoryBean.getObjectType()
      • Pool
      • Class
    • addLocators

      public void addLocators(ConnectionEndpoint... locators)
    • addLocators

      public void addLocators(Iterable<ConnectionEndpoint> locators)
    • addServers

      public void addServers(ConnectionEndpoint... servers)
    • addServers

      public void addServers(Iterable<ConnectionEndpoint> servers)
    • getCompositePoolConfigurer

      protected PoolConfigurer getCompositePoolConfigurer()
      Returns a reference to the Composite PoolConfigurer used to apply additional configuration to this PoolFactoryBean on Spring container initialization.
      Returns:
      the Composite PoolConfigurer.
      See Also:
    • setName

      public void setName(String name)
      Configures the name of the Pool bean.
      Parameters:
      name - String containing the name for the Pool bean.
      See Also:
    • getName

      protected String getName()
      Gets the configured name of the Pool bean.
      Returns:
      the configured name of the Pool bean.
      See Also:
    • setPool

      public void setPool(@Nullable org.apache.geode.cache.client.Pool pool)
      Configures the Pool to be returned by this PoolFactoryBean.
      Parameters:
      pool - the Pool to be returned by this PoolFactoryBean.
      See Also:
      • Pool
    • getPool

      @NonNull public org.apache.geode.cache.client.Pool getPool()
      Gets the Pool configured and built by this PoolFactoryBean. May return a proxy Pool if the actual Pool has not yet been configured and built by this PoolFactoryBean. In this case, the proxy Pool object will have the same configuration as the final Pool built by this PoolFactoryBean.
      Returns:
      the Pool configured and built by this PoolFactoryBean.
      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

      public void setLocators(ConnectionEndpoint[] locators)
    • setLocators

      public void setLocators(Iterable<ConnectionEndpoint> locators)
    • setMaxConnections

      public void setMaxConnections(int maxConnections)
    • setMinConnections

      public void setMinConnections(int minConnections)
    • setMaxConnectionsPerServer

      public void setMaxConnectionsPerServer(int maxConnectionsPerServer)
    • setMinConnectionsPerServer

      public void setMinConnectionsPerServer(int minConnectionsPerServer)
    • setMultiUserAuthentication

      public void setMultiUserAuthentication(boolean multiUserAuthentication)
    • setPingInterval

      public void setPingInterval(long pingInterval)
    • setPoolConfigurers

      public void setPoolConfigurers(PoolConfigurer... poolConfigurers)
      Null-safe operation to set an array of PoolConfigurers used to apply additional configuration to this PoolFactoryBean when using Annotation-based configuration.
      Parameters:
      poolConfigurers - array of PoolConfigurers used to apply additional configuration to this PoolFactoryBean.
      See Also:
    • setPoolConfigurers

      public void setPoolConfigurers(List<PoolConfigurer> poolConfigurers)
      Null-safe operation to set an Iterable of PoolConfigurers used to apply additional configuration to this PoolFactoryBean when using Annotation-based configuration.
      Parameters:
      poolConfigurers - Iterable of PoolConfigurers used to apply additional configuration to this PoolFactoryBean.
      See Also:
    • setPoolFactoryInitializer

      public void setPoolFactoryInitializer(PoolFactoryBean.PoolFactoryInitializer poolFactoryInitializer)
      Sets the PoolFactoryBean.PoolFactoryInitializer to initialize the PoolFactory used by this PoolFactoryBean to create a Pool.
      Parameters:
      poolFactoryInitializer - PoolFactoryBean.PoolFactoryInitializer user provided callback interface invoked by this PoolFactoryBean to initialize the PoolFactory constructed to create the Pool.
      See Also:
    • setPoolResolver

      public void setPoolResolver(PoolResolver poolResolver)
      Configures the PoolResolver to resolve Pool objects by name from the Apache Geode cache.
      Parameters:
      poolResolver - the configured PoolResolver used to resolve Pool objects by name.
      See Also:
    • getPoolResolver

      public PoolResolver getPoolResolver()
      Returns the configured PoolResolver used to resolve Pool object by name.
      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

      public void setServerGroup(String serverGroup)
    • setServers

      public void setServers(ConnectionEndpoint[] servers)
    • setServers

      public void setServers(Iterable<ConnectionEndpoint> servers)
    • 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

      public void setXmlDeclaredLocators(ConnectionEndpointList xmlDeclaredLocators)
    • setXmlDeclaredServers

      public void setXmlDeclaredServers(ConnectionEndpointList xmlDeclaredServers)