Package org.springframework.data.redis.connection.jedis

Examples of org.springframework.data.redis.connection.jedis.JedisConnectionFactory.afterPropertiesSet()


    // 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


    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

    jedisConnFactory.setUsePool(true);

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

    jedisConnFactory.afterPropertiesSet();

    RedisTemplate<String, String> genericTemplate = new StringRedisTemplate(jedisConnFactory);

    RedisTemplate<String, String> xstreamGenericTemplate = new RedisTemplate<String, String>();
    xstreamGenericTemplate.setConnectionFactory(jedisConnFactory);
View Full Code Here

    jedisConnFactory.setUsePool(true);

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

    jedisConnFactory.afterPropertiesSet();

    RedisTemplate<String, String> stringTemplate = new StringRedisTemplate(jedisConnFactory);
    RedisTemplate<String, Person> personTemplate = new RedisTemplate<String, Person>();
    personTemplate.setConnectionFactory(jedisConnFactory);
    personTemplate.afterPropertiesSet();
View Full Code Here

    JedisConnectionFactory jedisConnFactory = new JedisConnectionFactory();
    jedisConnFactory.getPoolConfig().setMaxTotal(defaultPoolConfig.getMaxTotal());
    jedisConnFactory.setUsePool(true);
    jedisConnFactory.setPort(SettingsUtils.getPort());
    jedisConnFactory.setHostName(SettingsUtils.getHost());
    jedisConnFactory.afterPropertiesSet();

    RedisTemplate genericTemplate = new RedisTemplate();
    genericTemplate.setConnectionFactory(jedisConnFactory);
    genericTemplate.afterPropertiesSet();
View Full Code Here

  @Parameters
  public static Collection<Object[]> testParams() {

    JedisConnectionFactory jedis = new JedisConnectionFactory();
    jedis.setPort(6379);
    jedis.afterPropertiesSet();

    LettuceConnectionFactory lettuce = new LettuceConnectionFactory();
    lettuce.setPort(6379);
    lettuce.afterPropertiesSet();
View Full Code Here

    assumeTrue(key1 instanceof String && value1 instanceof String);
    // Jedis does not support pTtl
    JedisConnectionFactory factory = new JedisConnectionFactory();
    factory.setHostName(SettingsUtils.getHost());
    factory.setPort(SettingsUtils.getPort());
    factory.afterPropertiesSet();
    final StringRedisTemplate template2 = new StringRedisTemplate(factory);
    template2.boundValueOps((String) key1).set((String) value1);
    template2.expire((String) key1, 5, TimeUnit.SECONDS);
    long expire = template2.getExpire((String) key1, TimeUnit.MILLISECONDS);
    // we should still get expire in milliseconds if requested
View Full Code Here

    assumeTrue(key1 instanceof String && value1 instanceof String);
    // Jedis does not support pExpireAt
    JedisConnectionFactory factory = new JedisConnectionFactory();
    factory.setHostName(SettingsUtils.getHost());
    factory.setPort(SettingsUtils.getPort());
    factory.afterPropertiesSet();
    final StringRedisTemplate template2 = new StringRedisTemplate(factory);
    template2.boundValueOps((String) key1).set((String) value1);
    template2.expireAt((String) key1, new Date(System.currentTimeMillis() + 5l));
    // Just ensure this works as expected, pExpireAt just adds some precision over expireAt
    waitFor(new TestCondition() {
View Full Code Here

    ObjectFactory<byte[]> rawFactory = new RawObjectFactory();

    JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory();
    jedisConnectionFactory.setPort(SettingsUtils.getPort());
    jedisConnectionFactory.setHostName(SettingsUtils.getHost());
    jedisConnectionFactory.afterPropertiesSet();

    RedisTemplate<String, String> stringTemplate = new StringRedisTemplate();
    stringTemplate.setConnectionFactory(jedisConnectionFactory);
    stringTemplate.afterPropertiesSet();
View Full Code Here

    }

    JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory();
    jedisConnectionFactory.setPort(SettingsUtils.getPort());
    jedisConnectionFactory.setHostName(SettingsUtils.getHost());
    jedisConnectionFactory.afterPropertiesSet();

    RedisTemplate<String, String> stringTemplate = new StringRedisTemplate();
    stringTemplate.setConnectionFactory(jedisConnectionFactory);
    stringTemplate.afterPropertiesSet();
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.