Class DefaultLettucePool

java.lang.Object
org.springframework.data.redis.connection.lettuce.DefaultLettucePool
All Implemented Interfaces:
InitializingBean, LettucePool, Pool<io.lettuce.core.api.StatefulConnection<byte[],byte[]>>

@Deprecated public class DefaultLettucePool extends Object implements LettucePool, InitializingBean
Deprecated.
since 2.0, use pooling via LettucePoolingClientConfiguration.
Default implementation of LettucePool.
Author:
Jennifer Hickey, Christoph Strobl, Mark Paluch
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Constructs a new DefaultLettucePool instance with default settings.
    DefaultLettucePool(String hostName, int port)
    Deprecated.
    Uses the GenericObjectPoolConfig defaults for configuring the connection pool
    DefaultLettucePool(String hostName, int port, org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig)
    Deprecated.
    Uses the RedisClient defaults for configuring the connection pool
    Deprecated.
    Uses the RedisSentinelConfiguration and RedisClient defaults for configuring the connection pool based on sentinels.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated.
     
    void
    Deprecated.
    Destroys the pool
    io.lettuce.core.RedisClient
    Deprecated.
     
    io.lettuce.core.resource.ClientResources
    Deprecated.
    Get the ClientResources to reuse infrastructure.
    int
    Deprecated.
    Returns the index of the database.
    Deprecated.
    Returns the current host.
    Deprecated.
    Returns the password used for authenticating with the Redis server.
    org.apache.commons.pool2.impl.GenericObjectPoolConfig
    Deprecated.
     
    int
    Deprecated.
    Returns the current port.
    io.lettuce.core.api.StatefulConnection<byte[],byte[]>
    Deprecated.
     
    long
    Deprecated.
    Returns the connection timeout (in milliseconds).
    boolean
    Deprecated.
     
    void
    returnBrokenResource(io.lettuce.core.api.StatefulConnection<byte[],byte[]> resource)
    Deprecated.
     
    void
    returnResource(io.lettuce.core.api.StatefulConnection<byte[],byte[]> resource)
    Deprecated.
     
    void
    setClientResources(io.lettuce.core.resource.ClientResources clientResources)
    Deprecated.
    Sets the ClientResources to reuse the client infrastructure.
    void
    setDatabase(int index)
    Deprecated.
    Sets the index of the database used by this connection pool.
    void
    Deprecated.
    Sets the host.
    void
    setPassword(String password)
    Deprecated.
    Sets the password used for authenticating with the Redis server.
    void
    setPoolConfig(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig)
    Deprecated.
     
    void
    setPort(int port)
    Deprecated.
    Sets the port.
    void
    setTimeout(long timeout)
    Deprecated.
    Sets the connection timeout (in milliseconds).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultLettucePool

      public DefaultLettucePool()
      Deprecated.
      Constructs a new DefaultLettucePool instance with default settings.
    • DefaultLettucePool

      public DefaultLettucePool(String hostName, int port)
      Deprecated.
      Uses the GenericObjectPoolConfig defaults for configuring the connection pool
      Parameters:
      hostName - The Redis host
      port - The Redis port
    • DefaultLettucePool

      public DefaultLettucePool(RedisSentinelConfiguration sentinelConfiguration)
      Deprecated.
      Uses the RedisSentinelConfiguration and RedisClient defaults for configuring the connection pool based on sentinels.
      Parameters:
      sentinelConfiguration - The Sentinel configuration
      Since:
      1.6
    • DefaultLettucePool

      public DefaultLettucePool(String hostName, int port, org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig)
      Deprecated.
      Uses the RedisClient defaults for configuring the connection pool
      Parameters:
      hostName - The Redis host
      port - The Redis port
      poolConfig - The pool GenericObjectPoolConfig
  • Method Details

    • isRedisSentinelAware

      public boolean isRedisSentinelAware()
      Deprecated.
      Returns:
      true when RedisSentinelConfiguration is present.
      Since:
      1.6
    • afterPropertiesSet

      public void afterPropertiesSet()
      Deprecated.
      Specified by:
      afterPropertiesSet in interface InitializingBean
    • getResource

      public io.lettuce.core.api.StatefulConnection<byte[],byte[]> getResource()
      Deprecated.
      Specified by:
      getResource in interface Pool<io.lettuce.core.api.StatefulConnection<byte[],byte[]>>
      Returns:
      A resource, if available
    • returnBrokenResource

      public void returnBrokenResource(io.lettuce.core.api.StatefulConnection<byte[],byte[]> resource)
      Deprecated.
      Specified by:
      returnBrokenResource in interface Pool<io.lettuce.core.api.StatefulConnection<byte[],byte[]>>
      Parameters:
      resource - A broken resource that should be invalidated
    • returnResource

      public void returnResource(io.lettuce.core.api.StatefulConnection<byte[],byte[]> resource)
      Deprecated.
      Specified by:
      returnResource in interface Pool<io.lettuce.core.api.StatefulConnection<byte[],byte[]>>
      Parameters:
      resource - A resource to return to the pool
    • destroy

      public void destroy()
      Deprecated.
      Description copied from interface: Pool
      Destroys the pool
      Specified by:
      destroy in interface Pool<io.lettuce.core.api.StatefulConnection<byte[],byte[]>>
    • getClient

      @Nullable public io.lettuce.core.RedisClient getClient()
      Deprecated.
      Specified by:
      getClient in interface LettucePool
      Returns:
      The Redis client
    • getPoolConfig

      public org.apache.commons.pool2.impl.GenericObjectPoolConfig getPoolConfig()
      Deprecated.
      Returns:
      The pool configuration
    • setPoolConfig

      public void setPoolConfig(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig)
      Deprecated.
      Parameters:
      poolConfig - The pool configuration to use
    • getDatabase

      public int getDatabase()
      Deprecated.
      Returns the index of the database.
      Returns:
      Returns the database index
    • setDatabase

      public void setDatabase(int index)
      Deprecated.
      Sets the index of the database used by this connection pool. Default is 0.
      Parameters:
      index - database index
    • getPassword

      @Nullable public String getPassword()
      Deprecated.
      Returns the password used for authenticating with the Redis server.
      Returns:
      password for authentication
    • setPassword

      public void setPassword(String password)
      Deprecated.
      Sets the password used for authenticating with the Redis server.
      Parameters:
      password - the password to set
    • getHostName

      public String getHostName()
      Deprecated.
      Returns the current host.
      Returns:
      the host
    • setHostName

      public void setHostName(String host)
      Deprecated.
      Sets the host.
      Parameters:
      host - the host to set
    • getPort

      public int getPort()
      Deprecated.
      Returns the current port.
      Returns:
      the port
    • setPort

      public void setPort(int port)
      Deprecated.
      Sets the port.
      Parameters:
      port - the port to set
    • getTimeout

      public long getTimeout()
      Deprecated.
      Returns the connection timeout (in milliseconds).
      Returns:
      connection timeout
    • setTimeout

      public void setTimeout(long timeout)
      Deprecated.
      Sets the connection timeout (in milliseconds).
      Parameters:
      timeout - connection timeout
    • getClientResources

      @Nullable public io.lettuce.core.resource.ClientResources getClientResources()
      Deprecated.
      Get the ClientResources to reuse infrastructure.
      Returns:
      null if not set.
      Since:
      1.7
    • setClientResources

      public void setClientResources(io.lettuce.core.resource.ClientResources clientResources)
      Deprecated.
      Sets the ClientResources to reuse the client infrastructure.
      Set to null to not share resources.
      Parameters:
      clientResources - can be null.
      Since:
      1.7