当前位置: 首页>>代码示例>>Java>>正文


Java StringRedisTemplate.setConnectionFactory方法代码示例

本文整理汇总了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();
}
 
开发者ID:shopping24,项目名称:redjob,代码行数:13,代码来源:LockDaoImplIT.java

示例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();
}
 
开发者ID:shopping24,项目名称:redjob,代码行数:12,代码来源:WorkerDaoImplIT.java

示例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;
}
 
开发者ID:yu199195,项目名称:happylifeplat-transaction,代码行数:9,代码来源:RedisClusterConfig.java

示例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;
}
 
开发者ID:ihaolin,项目名称:diablo,代码行数:9,代码来源:RedisConfig.java

示例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;
}
 
开发者ID:idreamshen,项目名称:spring-boot-with-multi-redis,代码行数:8,代码来源:RedisConfiguration.java

示例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;
}
 
开发者ID:idreamshen,项目名称:spring-boot-with-multi-redis,代码行数:8,代码来源:RedisConfiguration.java

示例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;
}
 
开发者ID:veritasware,项目名称:neto,代码行数:7,代码来源:RedisConfig.java

示例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;
}
 
开发者ID:veritasware,项目名称:neto,代码行数:7,代码来源:AppConfig.java

示例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;
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:7,代码来源:RedisConfig.java

示例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;
}
 
开发者ID:idreamshen,项目名称:spring-boot-with-multi-redis,代码行数:7,代码来源:RedisConfiguration.java

示例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;
}
 
开发者ID:idreamshen,项目名称:spring-boot-with-multi-redis,代码行数:7,代码来源:RedisConfiguration.java

示例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;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-app-starters,代码行数:7,代码来源:RedisSinkApplicationTests.java

示例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;
}
 
开发者ID:jayqqaa12,项目名称:jbase,代码行数:7,代码来源:RedisConfig.java

示例15: stringRedisTemplate

import org.springframework.data.redis.core.StringRedisTemplate; //导入方法依赖的package包/类
@Bean
public StringRedisTemplate stringRedisTemplate() {

    StringRedisTemplate redisTemplate = new StringRedisTemplate();

    redisTemplate.setConnectionFactory(redisConnectionFactory());

    return redisTemplate;
}
 
开发者ID:emersonf,项目名称:binary-diff,代码行数:10,代码来源:RedisConfiguration.java


注:本文中的org.springframework.data.redis.core.StringRedisTemplate.setConnectionFactory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。