Examples of RedisTemplate


Examples of org.springframework.data.keyvalue.redis.core.RedisTemplate

    jedisConnFactory.setUsePool(false);
    jedisConnFactory.setPort(SettingsUtils.getPort());
    jedisConnFactory.setHostName(SettingsUtils.getHost());
    jedisConnFactory.afterPropertiesSet();

    RedisTemplate genericTemplate = new RedisTemplate();
    genericTemplate.setConnectionFactory(jedisConnFactory);
    genericTemplate.afterPropertiesSet();

    RedisTemplate<String, String> xstreamGenericTemplate = new RedisTemplate<String, String>();
    xstreamGenericTemplate.setConnectionFactory(jedisConnFactory);
    xstreamGenericTemplate.setDefaultSerializer(serializer);
    xstreamGenericTemplate.afterPropertiesSet();

    RedisTemplate<String, Person> jsonPersonTemplate = new RedisTemplate<String, Person>();
    jsonPersonTemplate.setConnectionFactory(jedisConnFactory);
    jsonPersonTemplate.setDefaultSerializer(jsonSerializer);
    jsonPersonTemplate.setHashKeySerializer(jsonSerializer);
    jsonPersonTemplate.setHashValueSerializer(jsonStringSerializer);
    jsonPersonTemplate.afterPropertiesSet();

    // JRedis
    JredisConnectionFactory jredisConnFactory = new JredisConnectionFactory();
    jredisConnFactory.setUsePool(true);
    jredisConnFactory.setPort(SettingsUtils.getPort());
    jredisConnFactory.setHostName(SettingsUtils.getHost());
    jredisConnFactory.afterPropertiesSet();

    RedisTemplate genericTemplateJR = new RedisTemplate();
    genericTemplateJR.setConnectionFactory(jredisConnFactory);
    genericTemplateJR.afterPropertiesSet();

    RedisTemplate<String, Person> xGenericTemplateJR = new RedisTemplate<String, Person>();
    xGenericTemplateJR.setConnectionFactory(jredisConnFactory);
    xGenericTemplateJR.setDefaultSerializer(serializer);
    xGenericTemplateJR.afterPropertiesSet();

    RedisTemplate<String, Person> jsonPersonTemplateJR = new RedisTemplate<String, Person>();
    jsonPersonTemplateJR.setConnectionFactory(jredisConnFactory);
    jsonPersonTemplateJR.setDefaultSerializer(jsonSerializer);
    jsonPersonTemplateJR.setHashKeySerializer(jsonSerializer);
    jsonPersonTemplateJR.setHashValueSerializer(jsonStringSerializer);
    jsonPersonTemplateJR.afterPropertiesSet();

    // RJC

    // rjc
    RjcConnectionFactory rjcConnFactory = new RjcConnectionFactory();
    rjcConnFactory.setUsePool(true);
    rjcConnFactory.setPort(SettingsUtils.getPort());
    rjcConnFactory.setHostName(SettingsUtils.getHost());
    rjcConnFactory.afterPropertiesSet();

    RedisTemplate genericTemplateRJC = new RedisTemplate();
    genericTemplateRJC.setConnectionFactory(rjcConnFactory);
    genericTemplateRJC.afterPropertiesSet();

    RedisTemplate<String, Person> xGenericTemplateRJC = new RedisTemplate<String, Person>();
    xGenericTemplateRJC.setConnectionFactory(rjcConnFactory);
    xGenericTemplateRJC.setDefaultSerializer(serializer);
    xGenericTemplateRJC.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.data.redis.core.RedisTemplate

        connectionFactory = jedisConnectionFactory;
        return jedisConnectionFactory;
    }

    private RedisTemplate createDefaultTemplate() {
        redisTemplate = new RedisTemplate();
        redisTemplate.setDefaultSerializer(getSerializer());
        redisTemplate.setConnectionFactory(getConnectionFactory());
        redisTemplate.afterPropertiesSet();
        return redisTemplate;
    }
View Full Code Here

Examples of org.springframework.data.redis.core.RedisTemplate

        connectionFactory = jedisConnectionFactory;
        return jedisConnectionFactory;
    }

    private RedisTemplate createDefaultTemplate() {
        redisTemplate = new RedisTemplate();
        redisTemplate.setConnectionFactory(getConnectionFactory());
        redisTemplate.afterPropertiesSet();
        return redisTemplate;
    }
View Full Code Here

Examples of org.springframework.data.redis.core.RedisTemplate

    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = super.createRegistry();

        redisTemplate = new RedisTemplate();
        redisTemplate.setConnectionFactory(CONNECTION_FACTORY);
        redisTemplate.afterPropertiesSet();

        registry.bind("redisTemplate", redisTemplate);
        registry.bind("listenerContainer", LISTENER_CONTAINER);
View Full Code Here

Examples of org.springframework.data.redis.core.RedisTemplate

    }

    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = super.createRegistry();
        redisTemplate = new RedisTemplate();
        redisTemplate.setConnectionFactory(CONNECTION_FACTORY);
        redisTemplate.afterPropertiesSet();

        registry.bind("redisTemplate", redisTemplate);
        return registry;
View Full Code Here

Examples of org.springframework.data.redis.core.RedisTemplate

        connectionFactory = jedisConnectionFactory;
        return jedisConnectionFactory;
    }

    private RedisTemplate createDefaultTemplate() {
        redisTemplate = new RedisTemplate();
        redisTemplate.setDefaultSerializer(getSerializer());
        redisTemplate.setConnectionFactory(getConnectionFactory());
        redisTemplate.afterPropertiesSet();
        return redisTemplate;
    }
View Full Code Here

Examples of org.springframework.data.redis.core.RedisTemplate

        connectionFactory = jedisConnectionFactory;
        return jedisConnectionFactory;
    }

    private RedisTemplate createDefaultTemplate() {
        redisTemplate = new RedisTemplate();
        redisTemplate.setConnectionFactory(getConnectionFactory());
        redisTemplate.afterPropertiesSet();
        return redisTemplate;
    }
View Full Code Here

Examples of org.springframework.data.redis.core.RedisTemplate

    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = super.createRegistry();

        redisTemplate = new RedisTemplate();
        redisTemplate.setConnectionFactory(CONNECTION_FACTORY);
        redisTemplate.afterPropertiesSet();

        registry.bind("redisTemplate", redisTemplate);
        registry.bind("listenerContainer", LISTENER_CONTAINER);
View Full Code Here

Examples of org.springframework.data.redis.core.RedisTemplate

  @SuppressWarnings({ "unchecked", "rawtypes" })
  @Before
  public void setUp() {

    redisTemplateSpy = spy(new RedisTemplate() {

      public Boolean hasKey(Object key) {
        return false;
      }
    });
View Full Code Here

Examples of org.springframework.data.redis.core.RedisTemplate

  @Before
  public void setUp() {

    when(redisConnectionFactoryMock.getConnection()).thenReturn(redisConnectionMock);

    redisTemplate = new RedisTemplate();
    redisTemplate.setConnectionFactory(redisConnectionFactoryMock);
    redisTemplate.afterPropertiesSet();

    cacheManager = new RedisCacheManager(redisTemplate);
  }
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.