private Object getConnection ( ) { /* * Jedis connection = factory.getConnection(); * * // If resource is not null means a transaction in progress. * * if (settings != null) { for (String key : settings.keySet()) { * connection.configSet(key, settings.get(key).toString()); } } * * if (resource != null && resource.isActive()) { return * ((RedisTransaction) resource).bindResource(connection); } else { * return connection; } if (resource == null || (resource != null && * !resource.isActive())) */ // means either transaction resource is not bound or it is not active, // but connection has already by initialized if ( isBoundTransaction ( ) && this . connection != null ) { return this . connection ; } // if running within transaction boundary. if ( resource != null && resource . isActive ( ) ) { // no need to get a connection from pool, as nested MULTI is not yet // supported. if ( ( ( RedisTransaction ) resource ) . isResourceBound ( ) ) { return ( ( RedisTransaction ) resource ) . getResource ( ) ; } else { Jedis conn = getAndSetConnection ( ) ; return ( ( RedisTransaction ) resource ) . bindResource ( conn ) ; } } else { Jedis conn = getAndSetConnection ( ) ; return conn ; } }
Returns jedis connection .