Examples of JedisConnectionFactory


Examples of org.springframework.data.redis.connection.jedis.JedisConnectionFactory

class RichGaugeHandlerTestsConfig {

  @Bean
  public RedisConnectionFactory connectionFactory() {
    try {
      JedisConnectionFactory cf = new JedisConnectionFactory();
      cf.setHostName("localhost");
      cf.setPort(6379);
      cf.afterPropertiesSet();
      cf.getConnection().close();
      return cf;
    } // The following is to have setup properly finishing
    // The actual test(s) won't be executed thx to RedisAvailableRule
    catch (RedisConnectionFailureException e) {
      RedisConnectionFactory mockCF = mock(RedisConnectionFactory.class);
View Full Code Here

Examples of org.springframework.data.redis.connection.jedis.JedisConnectionFactory

@EnableRedisHttpSession
public class Config {

    @Bean
    public JedisConnectionFactory connectionFactory() {
        return new JedisConnectionFactory();
    }
View Full Code Here

Examples of org.springframework.data.redis.connection.jedis.JedisConnectionFactory

        return builder.setType(EmbeddedDatabaseType.H2).build();
    }

    @Bean
    public JedisConnectionFactory connectionFactory() throws Exception {
        return new JedisConnectionFactory();
    }
View Full Code Here

Examples of org.springframework.data.redis.connection.jedis.JedisConnectionFactory

    @Configuration
    @EnableRedisHttpSession
    static class Config {
        @Bean
        public JedisConnectionFactory connectionFactory() throws Exception {
            JedisConnectionFactory factory = new JedisConnectionFactory();
            factory.setPort(getPort());
            factory.setUsePool(false);
            return factory;
        }
View Full Code Here

Examples of org.springframework.data.redis.connection.jedis.JedisConnectionFactory

    @Bean
    @ConditionalOnMissingBean
    public RedisConnectionFactory redisConnectionFactory()
        throws UnknownHostException {
      return applyProperties(new JedisConnectionFactory(getSentinelConfig()));
    }
View Full Code Here

Examples of org.springframework.data.redis.connection.jedis.JedisConnectionFactory

      return applyProperties(createJedisConnectionFactory());
    }

    private JedisConnectionFactory createJedisConnectionFactory() {
      if (this.properties.getPool() != null) {
        return new JedisConnectionFactory(getSentinelConfig(), jedisPoolConfig());
      }
      return new JedisConnectionFactory(getSentinelConfig());
    }
View Full Code Here

Examples of org.springframework.data.redis.connection.jedis.JedisConnectionFactory

   * Try to obtain and validate a resource. Implementors should either set the
   * {@link #resource} field with a valid resource and return normally, or throw an
   * exception.
   */
  protected JedisConnectionFactory obtainResource() throws Exception {
    JedisConnectionFactory resource = new JedisConnectionFactory();
    resource.afterPropertiesSet();
    resource.getConnection().close();
    return resource;
  }
View Full Code Here

Examples of org.springframework.data.redis.connection.jedis.JedisConnectionFactory

*/
public class BoundKeyParams {

  public static Collection<Object[]> testParams() {
    // Jedis
    JedisConnectionFactory jedisConnFactory = new JedisConnectionFactory();
    jedisConnFactory.setPort(SettingsUtils.getPort());
    jedisConnFactory.setHostName(SettingsUtils.getHost());
    jedisConnFactory.afterPropertiesSet();

    StringRedisTemplate templateJS = new StringRedisTemplate(jedisConnFactory);
    DefaultRedisMap mapJS = new DefaultRedisMap("bound:key:map", templateJS);
    DefaultRedisSet setJS = new DefaultRedisSet("bound:key:set", templateJS);
    RedisList list = new DefaultRedisList("bound:key:list", templateJS);
View Full Code Here

Examples of org.springframework.data.redis.connection.jedis.JedisConnectionFactory

*/
public abstract class AtomicCountersParam {

  public static Collection<Object[]> testParams() {
    // Jedis
    JedisConnectionFactory jedisConnFactory = new JedisConnectionFactory();
    jedisConnFactory.setPort(SettingsUtils.getPort());
    jedisConnFactory.setHostName(SettingsUtils.getHost());
    jedisConnFactory.setUsePool(true);
    jedisConnFactory.afterPropertiesSet();

    // JRedis
    JredisConnectionFactory jredisConnFactory = new JredisConnectionFactory(new JredisPool(SettingsUtils.getHost(),
        SettingsUtils.getPort()));
    jredisConnFactory.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.data.redis.connection.jedis.JedisConnectionFactory

  protected ObjectFactory<String> factory = new StringObjectFactory();
  protected StringRedisTemplate template;
  protected RedisStore col;

  public RedisCollectionFactoryBeanTests() {
    JedisConnectionFactory jedisConnFactory = new JedisConnectionFactory();
    jedisConnFactory.setUsePool(true);

    jedisConnFactory.setPort(SettingsUtils.getPort());
    jedisConnFactory.setHostName(SettingsUtils.getHost());

    jedisConnFactory.afterPropertiesSet();

    this.template = new StringRedisTemplate(jedisConnFactory);
    ConnectionFactoryTracker.add(jedisConnFactory);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.