Package redis.clients.jedis
Class JedisPool
- java.lang.Object
-
- redis.clients.jedis.util.Pool<Jedis>
-
- redis.clients.jedis.JedisPool
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class JedisPool extends Pool<Jedis>
JedisPool compatibility wrapper for Valkey GLIDE client. This class provides a Jedis-like connection pool API while using Valkey GLIDE underneath. It matches the original Jedis JedisPool API for maximum compatibility.
-
-
Field Summary
-
Fields inherited from class redis.clients.jedis.util.Pool
internalPool
-
-
Constructor Summary
Constructors Constructor Description JedisPool()Creates a JedisPool with default configuration connecting to localhost:6379.JedisPool(java.lang.String url)WARNING: This constructor only accepts a uri string asurl.JedisPool(java.lang.String host, int port)Creates a JedisPool connecting to the specified host and port.JedisPool(java.lang.String host, int port, boolean ssl)Creates a JedisPool connecting to the specified host and port with SSL configuration.JedisPool(java.lang.String host, int port, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)Creates a JedisPool connecting to the specified host and port with SSL configuration and custom SSL parameters.JedisPool(java.lang.String host, int port, int timeout)Creates a JedisPool connecting to the specified host and port with timeout configuration.JedisPool(java.lang.String host, int port, int timeout, java.lang.String password)Creates a JedisPool connecting to the specified host and port with timeout and password authentication.JedisPool(java.lang.String host, int port, java.lang.String password)Creates a JedisPool connecting to the specified host and port with password authentication.JedisPool(java.lang.String host, int port, java.lang.String user, java.lang.String password)Creates a JedisPool connecting to the specified host and port with user authentication.JedisPool(java.lang.String url, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)WARNING: This constructor only accepts a uri string asurl.JedisPool(java.net.URI uri)Creates a JedisPool connecting to the Redis server specified by the URI.JedisPool(java.net.URI uri, int timeout)Creates a JedisPool connecting to the Redis server specified by the URI with timeout configuration.JedisPool(java.net.URI uri, int timeout, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)Creates a JedisPool connecting to the Redis server specified by the URI with timeout and SSL configuration.JedisPool(java.net.URI uri, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)Creates a JedisPool connecting to the Redis server specified by the URI with SSL configuration.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig)Creates a JedisPool with custom pool configuration connecting to localhost:6379.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String url)Creates a JedisPool with custom pool configuration connecting to the Redis server specified by the URL.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port)Creates a JedisPool with custom pool configuration connecting to the specified host and port.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, boolean ssl)Creates a JedisPool with custom pool configuration connecting to the specified host and port with SSL.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)Creates a JedisPool with custom pool configuration connecting to the specified host and port with SSL and custom SSL parameters.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout)Creates a JedisPool with custom pool configuration connecting to the specified host and port with timeout.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String password, int database, java.lang.String clientName)JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String password, int database, java.lang.String clientName, boolean ssl)JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String password, int database, java.lang.String clientName, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String user, java.lang.String password, int database, java.lang.String clientName)JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String user, java.lang.String password, int database, java.lang.String clientName, boolean ssl)Creates a JedisPool with custom pool configuration connecting to the specified host and port with separate connection and socket timeouts, user authentication, database, client name, and SSL.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String user, java.lang.String password, int database, java.lang.String clientName, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String password)Creates a JedisPool with custom pool configuration connecting to the specified host and port with timeout and password.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String password, int database)Creates a JedisPool with custom pool configuration connecting to the specified host and port with timeout, password, and database.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String password, int database, java.lang.String clientName)Creates a JedisPool with custom pool configuration connecting to the specified host and port with timeout, password, database, and client name.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String password, int database, java.lang.String clientName, boolean ssl)JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String password, int database, java.lang.String clientName, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String user, java.lang.String password, int database, java.lang.String clientName)JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String user, java.lang.String password, int database, java.lang.String clientName, boolean ssl)JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, java.lang.String user, java.lang.String password)Creates a JedisPool with custom pool configuration connecting to the specified host and port with user authentication.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, JedisClientConfig clientConfig)Creates a JedisPool with custom pool configuration connecting to the specified host and port with client configuration.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.net.URI uri)Creates a JedisPool with custom pool configuration connecting to the Redis server specified by the URI.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.net.URI uri, int timeout)Creates a JedisPool with custom pool configuration connecting to the Redis server specified by the URI with timeout.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.net.URI uri, int timeout, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)Creates a JedisPool with custom pool configuration connecting to the Redis server specified by the URI with timeout and SSL configuration.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.net.URI uri, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)Creates a JedisPool with custom pool configuration connecting to the Redis server specified by the URI with SSL configuration.JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, org.apache.commons.pool2.PooledObjectFactory<Jedis> factory)Creates a JedisPool with custom pool configuration and a custom pooled object factory.JedisPool(org.apache.commons.pool2.PooledObjectFactory<Jedis> factory)Creates a JedisPool with a custom pooled object factory.JedisPool(HostAndPort hostAndPort, JedisClientConfig clientConfig)Creates a JedisPool with the specified host and port configuration and client configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidreturnResourceObject(Jedis resource)Return a resource to the pool.-
Methods inherited from class redis.clients.jedis.util.Pool
addObjects, close, closeInternalPool, getCreatedCount, getDestroyedCount, getMaxBorrowWaitTimeMillis, getMaxTotal, getMeanBorrowWaitTimeMillis, getNumActive, getNumIdle, getNumWaiters, getResource, initPool, initPool, invalidateObject, isClosed, returnResource
-
-
-
-
Constructor Detail
-
JedisPool
public JedisPool()
Creates a JedisPool with default configuration connecting to localhost:6379.
-
JedisPool
public JedisPool(java.lang.String url)
WARNING: This constructor only accepts a uri string asurl.JedisURIHelper.isValid(java.net.URI)can be used before this.To use a host string,
JedisPool(java.lang.String, int)can be used withProtocol.DEFAULT_PORT.- Parameters:
url- the Redis URI
-
JedisPool
public JedisPool(java.lang.String url, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)WARNING: This constructor only accepts a uri string asurl.JedisURIHelper.isValid(java.net.URI)can be used before this.To use a host string,
JedisPool(java.lang.String, int, boolean, javax.net.ssl.SSLSocketFactory, javax.net.ssl.SSLParameters, javax.net.ssl.HostnameVerifier)can be used withProtocol.DEFAULT_PORTandssl=true.- Parameters:
url- the Redis URIsslSocketFactory- SSL socket factorysslParameters- SSL parametershostnameVerifier- hostname verifier
-
JedisPool
public JedisPool(java.lang.String host, int port)Creates a JedisPool connecting to the specified host and port.- Parameters:
host- the Redis server hostport- the Redis server port
-
JedisPool
public JedisPool(java.lang.String host, int port, boolean ssl)Creates a JedisPool connecting to the specified host and port with SSL configuration.- Parameters:
host- the Redis server hostport- the Redis server portssl- whether to use SSL connection
-
JedisPool
public JedisPool(java.lang.String host, int port, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)Creates a JedisPool connecting to the specified host and port with SSL configuration and custom SSL parameters.- Parameters:
host- the Redis server hostport- the Redis server portssl- whether to use SSL connectionsslSocketFactory- SSL socket factory for creating SSL connectionssslParameters- SSL parameters for the connectionhostnameVerifier- hostname verifier for SSL connections
-
JedisPool
public JedisPool(java.lang.String host, int port, java.lang.String user, java.lang.String password)Creates a JedisPool connecting to the specified host and port with user authentication.- Parameters:
host- the Redis server hostport- the Redis server portuser- the username for authenticationpassword- the password for authentication
-
JedisPool
public JedisPool(java.lang.String host, int port, int timeout)Creates a JedisPool connecting to the specified host and port with timeout configuration.- Parameters:
host- the Redis server hostport- the Redis server porttimeout- the connection and socket timeout in milliseconds
-
JedisPool
public JedisPool(java.lang.String host, int port, java.lang.String password)Creates a JedisPool connecting to the specified host and port with password authentication.- Parameters:
host- the Redis server hostport- the Redis server portpassword- the password for authentication
-
JedisPool
public JedisPool(java.lang.String host, int port, int timeout, java.lang.String password)Creates a JedisPool connecting to the specified host and port with timeout and password authentication.- Parameters:
host- the Redis server hostport- the Redis server porttimeout- the connection and socket timeout in millisecondspassword- the password for authentication
-
JedisPool
public JedisPool(HostAndPort hostAndPort, JedisClientConfig clientConfig)
Creates a JedisPool with the specified host and port configuration and client configuration.- Parameters:
hostAndPort- the host and port configurationclientConfig- the client configuration
-
JedisPool
public JedisPool(org.apache.commons.pool2.PooledObjectFactory<Jedis> factory)
Creates a JedisPool with a custom pooled object factory.- Parameters:
factory- the pooled object factory for creating Jedis instances
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig)
Creates a JedisPool with custom pool configuration connecting to localhost:6379.- Parameters:
poolConfig- the pool configuration
-
JedisPool
public JedisPool(java.net.URI uri)
Creates a JedisPool connecting to the Redis server specified by the URI.- Parameters:
uri- the Redis server URI
-
JedisPool
public JedisPool(java.net.URI uri, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)Creates a JedisPool connecting to the Redis server specified by the URI with SSL configuration.- Parameters:
uri- the Redis server URIsslSocketFactory- SSL socket factory for creating SSL connectionssslParameters- SSL parameters for the connectionhostnameVerifier- hostname verifier for SSL connections
-
JedisPool
public JedisPool(java.net.URI uri, int timeout)Creates a JedisPool connecting to the Redis server specified by the URI with timeout configuration.- Parameters:
uri- the Redis server URItimeout- the connection and socket timeout in milliseconds
-
JedisPool
public JedisPool(java.net.URI uri, int timeout, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)Creates a JedisPool connecting to the Redis server specified by the URI with timeout and SSL configuration.- Parameters:
uri- the Redis server URItimeout- the connection and socket timeout in millisecondssslSocketFactory- SSL socket factory for creating SSL connectionssslParameters- SSL parameters for the connectionhostnameVerifier- hostname verifier for SSL connections
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String url)
Creates a JedisPool with custom pool configuration connecting to the Redis server specified by the URL. WARNING: This constructor only accepts a uri string asurl.JedisURIHelper.isValid(java.net.URI)can be used before this.To use a host string,
JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig, java.lang.String, int)can be used withProtocol.DEFAULT_PORT.- Parameters:
poolConfig- the pool configurationurl- the Redis server URL
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port)
Creates a JedisPool with custom pool configuration connecting to the specified host and port.- Parameters:
poolConfig- the pool configurationhost- the Redis server hostport- the Redis server port
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, boolean ssl)
Creates a JedisPool with custom pool configuration connecting to the specified host and port with SSL.- Parameters:
poolConfig- the pool configurationhost- the Redis server hostport- the Redis server portssl- whether to use SSL connection
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
Creates a JedisPool with custom pool configuration connecting to the specified host and port with SSL and custom SSL parameters.- Parameters:
poolConfig- the pool configurationhost- the Redis server hostport- the Redis server portssl- whether to use SSL connectionsslSocketFactory- SSL socket factory for creating SSL connectionssslParameters- SSL parameters for the connectionhostnameVerifier- hostname verifier for SSL connections
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout)
Creates a JedisPool with custom pool configuration connecting to the specified host and port with timeout.- Parameters:
poolConfig- the pool configurationhost- the Redis server hostport- the Redis server porttimeout- the connection and socket timeout in milliseconds
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String password)
Creates a JedisPool with custom pool configuration connecting to the specified host and port with timeout and password.- Parameters:
poolConfig- the pool configurationhost- the Redis server hostport- the Redis server porttimeout- the connection and socket timeout in millisecondspassword- the password for authentication
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String password, int database)
Creates a JedisPool with custom pool configuration connecting to the specified host and port with timeout, password, and database.- Parameters:
poolConfig- the pool configurationhost- the Redis server hostport- the Redis server porttimeout- the connection and socket timeout in millisecondspassword- the password for authenticationdatabase- the database number to select
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String password, int database, java.lang.String clientName)
Creates a JedisPool with custom pool configuration connecting to the specified host and port with timeout, password, database, and client name.- Parameters:
poolConfig- the pool configurationhost- the Redis server hostport- the Redis server porttimeout- the connection and socket timeout in millisecondspassword- the password for authenticationdatabase- the database number to selectclientName- the client name to set for connections
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String password, int database, java.lang.String clientName, boolean ssl)
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String password, int database, java.lang.String clientName, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String user, java.lang.String password, int database, java.lang.String clientName)
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int timeout, java.lang.String user, java.lang.String password, int database, java.lang.String clientName, boolean ssl)
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String password, int database, java.lang.String clientName)
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String password, int database, java.lang.String clientName, boolean ssl)
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String password, int database, java.lang.String clientName, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String user, java.lang.String password, int database, java.lang.String clientName)
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String user, java.lang.String password, int database, java.lang.String clientName, boolean ssl)
Creates a JedisPool with custom pool configuration connecting to the specified host and port with separate connection and socket timeouts, user authentication, database, client name, and SSL.- Parameters:
poolConfig- the pool configurationhost- the Redis server hostport- the Redis server portconnectionTimeout- the connection timeout in millisecondssoTimeout- the socket timeout in millisecondsuser- the username for authenticationpassword- the password for authenticationdatabase- the database number to selectclientName- the client name to set for connectionsssl- whether to use SSL connection
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, int connectionTimeout, int soTimeout, java.lang.String user, java.lang.String password, int database, java.lang.String clientName, boolean ssl, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, java.lang.String user, java.lang.String password)
Creates a JedisPool with custom pool configuration connecting to the specified host and port with user authentication.- Parameters:
poolConfig- the pool configurationhost- the Redis server hostport- the Redis server portuser- the username for authenticationpassword- the password for authentication
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.lang.String host, int port, JedisClientConfig clientConfig)
Creates a JedisPool with custom pool configuration connecting to the specified host and port with client configuration. This is the main constructor that most other constructors delegate to.- Parameters:
poolConfig- the pool configuration for managing the connection poolhost- the Redis server hostport- the Redis server portclientConfig- the client configuration including timeouts, authentication, SSL settings, etc.
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.net.URI uri)
Creates a JedisPool with custom pool configuration connecting to the Redis server specified by the URI.- Parameters:
poolConfig- the pool configurationuri- the Redis server URI
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.net.URI uri, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
Creates a JedisPool with custom pool configuration connecting to the Redis server specified by the URI with SSL configuration.- Parameters:
poolConfig- the pool configurationuri- the Redis server URIsslSocketFactory- SSL socket factory for creating SSL connectionssslParameters- SSL parameters for the connectionhostnameVerifier- hostname verifier for SSL connections
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.net.URI uri, int timeout)
Creates a JedisPool with custom pool configuration connecting to the Redis server specified by the URI with timeout.- Parameters:
poolConfig- the pool configurationuri- the Redis server URItimeout- the connection and socket timeout in milliseconds
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, java.net.URI uri, int timeout, javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.SSLParameters sslParameters, javax.net.ssl.HostnameVerifier hostnameVerifier)
Creates a JedisPool with custom pool configuration connecting to the Redis server specified by the URI with timeout and SSL configuration.- Parameters:
poolConfig- the pool configurationuri- the Redis server URItimeout- the connection and socket timeout in millisecondssslSocketFactory- SSL socket factory for creating SSL connectionssslParameters- SSL parameters for the connectionhostnameVerifier- hostname verifier for SSL connections
-
JedisPool
public JedisPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig<Jedis> poolConfig, org.apache.commons.pool2.PooledObjectFactory<Jedis> factory)
Creates a JedisPool with custom pool configuration and a custom pooled object factory.- Parameters:
poolConfig- the pool configurationfactory- the pooled object factory for creating Jedis instances
-
-
Method Detail
-
returnResourceObject
protected void returnResourceObject(Jedis resource)
Description copied from class:PoolReturn a resource to the pool.- Overrides:
returnResourceObjectin classPool<Jedis>- Parameters:
resource- the resource to return
-
-