當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。