本文整理汇总了Java中org.springframework.data.redis.core.StringRedisTemplate.setConnectionFactory方法的典型用法代码示例。如果您正苦于以下问题:Java StringRedisTemplate.setConnectionFactory方法的具体用法?Java StringRedisTemplate.setConnectionFactory怎么用?Java StringRedisTemplate.setConnectionFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.data.redis.core.StringRedisTemplate
的用法示例。
在下文中一共展示了StringRedisTemplate.setConnectionFactory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
RedisConnectionFactory connectionFactory = TestRedis.connectionFactory();
dao.setConnectionFactory(connectionFactory);
dao.setNamespace("namespace");
dao.afterPropertiesSet();
redis = new StringRedisTemplate();
redis.setConnectionFactory(connectionFactory);
redis.afterPropertiesSet();
}
示例2: setUp
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
RedisConnectionFactory connectionFactory = TestRedis.connectionFactory();
dao.setConnectionFactory(connectionFactory);
dao.setNamespace("namespace");
dao.afterPropertiesSet();
redis = new StringRedisTemplate();
redis.setConnectionFactory(connectionFactory);
redis.afterPropertiesSet();
}
示例3: getStringRedisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean
public RedisTemplate getStringRedisTemplate() {
StringRedisTemplate clusterTemplate = new StringRedisTemplate();
clusterTemplate.setConnectionFactory(jedisConnectionFactory());
clusterTemplate.setKeySerializer(new StringRedisSerializer());
clusterTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
return clusterTemplate;
}
示例4: redisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean
@Primary
public StringRedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) {
StringRedisTemplate template = new StringRedisTemplate();
template.setConnectionFactory(connectionFactory);
template.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
return template;
}
示例5: stringRedisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean
@ConditionalOnMissingBean(StringRedisTemplate.class)
public StringRedisTemplate stringRedisTemplate(
RedisConnectionFactory redisConnectionFactory)
throws UnknownHostException {
StringRedisTemplate template = new StringRedisTemplate();
template.setConnectionFactory(redisConnectionFactory);
return template;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:RedisAutoConfiguration.java
示例6: userRedisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean(name = "userRedisTemplate")
public RedisTemplate userRedisTemplate(@Qualifier("userRedisConnectionFactory") RedisConnectionFactory cf) {
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(cf);
setSerializer(stringRedisTemplate);
return stringRedisTemplate;
}
示例7: roleRedisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean(name = "roleRedisTemplate")
public RedisTemplate roleRedisTemplate(@Qualifier("roleRedisConnectionFactory") RedisConnectionFactory cf) {
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(cf);
setSerializer(stringRedisTemplate);
return stringRedisTemplate;
}
示例8: redisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean
public RedisTemplate redisTemplate(JedisConnectionFactory jedisConnectionFactory) {
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(jedisConnectionFactory);
return stringRedisTemplate;
}
示例9: redisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean(name = "redisTemplate")
public RedisTemplate redisTemplate(JedisConnectionFactory jedisConnectionFactory) {
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(jedisConnectionFactory);
return stringRedisTemplate;
}
示例10: redisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean
public RedisTemplate<String, String> redisTemplate() {
StringRedisTemplate rt = new StringRedisTemplate();
rt.setConnectionFactory(redisConnectionFactory());
return rt;
}
示例11: userStringRedisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean(name = "userStringRedisTemplate")
public StringRedisTemplate userStringRedisTemplate(@Qualifier("userRedisConnectionFactory") RedisConnectionFactory cf) {
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(cf);
return stringRedisTemplate;
}
示例12: roleStringRedisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean(name = "roleStringRedisTemplate")
public StringRedisTemplate roleStringRedisTemplate(@Qualifier("roleRedisConnectionFactory") RedisConnectionFactory cf) {
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(cf);
return stringRedisTemplate;
}
示例13: createStringRedisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
protected StringRedisTemplate createStringRedisTemplate(RedisConnectionFactory connectionFactory) {
StringRedisTemplate redisTemplate = new StringRedisTemplate();
redisTemplate.setConnectionFactory(connectionFactory);
redisTemplate.afterPropertiesSet();
return redisTemplate;
}
示例14: stringRedisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean
public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
StringRedisTemplate template = new StringRedisTemplate();
template.setConnectionFactory(redisConnectionFactory);
return template;
}
示例15: stringRedisTemplate
import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean
public StringRedisTemplate stringRedisTemplate() {
StringRedisTemplate redisTemplate = new StringRedisTemplate();
redisTemplate.setConnectionFactory(redisConnectionFactory());
return redisTemplate;
}