|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.data.redis.core.RedisConnectionUtils
public abstract class RedisConnectionUtils
Helper class featuring RedisConnection handling, allowing for reuse of instances within
'transactions'/scopes.
| Constructor Summary | |
|---|---|
RedisConnectionUtils()
|
|
| Method Summary | |
|---|---|
static RedisConnection |
bindConnection(RedisConnectionFactory factory)
Binds a new Redis connection (from the given factory) to the current thread, if none is already bound. |
static RedisConnection |
doGetConnection(RedisConnectionFactory factory,
boolean allowCreate,
boolean bind)
Gets a Redis connection. |
static RedisConnection |
getConnection(RedisConnectionFactory factory)
Gets a Redis connection from the given factory. |
static boolean |
isConnectionTransactional(RedisConnection conn,
RedisConnectionFactory connFactory)
Return whether the given Redis connection is transactional, that is, bound to the current thread by Spring's transaction facilities. |
static void |
releaseConnection(RedisConnection conn,
RedisConnectionFactory factory)
Closes the given connection, created via the given factory if not managed externally (i.e. not bound to the thread). |
static void |
unbindConnection(RedisConnectionFactory factory)
Unbinds and closes the connection (if any) associated with the given factory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RedisConnectionUtils()
| Method Detail |
|---|
public static RedisConnection bindConnection(RedisConnectionFactory factory)
factory - connection factory
public static RedisConnection getConnection(RedisConnectionFactory factory)
factory - connection factory for creating the connection
public static RedisConnection doGetConnection(RedisConnectionFactory factory,
boolean allowCreate,
boolean bind)
allowCreate is true.
factory - connection factory for creating the connectionallowCreate - whether a new (unbound) connection should be created when no connection can be found for the
current threadbind - binds the connection to the thread, in case one was created
public static void releaseConnection(RedisConnection conn,
RedisConnectionFactory factory)
conn - the Redis connection to closefactory - the Redis factory that the connection was created withpublic static void unbindConnection(RedisConnectionFactory factory)
factory - Redis factory
public static boolean isConnectionTransactional(RedisConnection conn,
RedisConnectionFactory connFactory)
conn - Redis connection to checkconnFactory - Redis connection factory that the connection was created with
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||