Example usage for org.springframework.data.redis.connection.jedis JedisConnectionFactory setHostName

List of usage examples for org.springframework.data.redis.connection.jedis JedisConnectionFactory setHostName

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection.jedis JedisConnectionFactory setHostName.

Prototype

@Deprecated
public void setHostName(String hostName) 

Source Link

Document

Sets the Redis hostname.

Usage

From source file:com.springsource.html5expense.config.LocalJedisConnectionFactoryConfiguration.java

@Override
@Bean/*from w  w w .j  a  va2 s.c o m*/
public RedisConnectionFactory redisConnectionFactory() throws Exception {
    JedisConnectionFactory factory = new JedisConnectionFactory();
    factory.setHostName(propertyResolver.getProperty("redis.host"));
    factory.setPort(Integer.parseInt(propertyResolver.getProperty("redis.port")));
    factory.setPassword(propertyResolver.getProperty("redis.pass"));
    return factory;
}

From source file:com.springsource.greenhouse.config.KeyValueConfig.java

@Bean
public RedisConnectionFactory redisConnectionFactory() {
    JedisConnectionFactory redis = new JedisConnectionFactory();
    redis.setHostName(environment.getProperty("redis.hostName"));
    redis.setPort(environment.getProperty("redis.port", Integer.class));
    redis.setPassword(environment.getProperty("redis.password"));
    return redis;
}

From source file:com.coffeebeans.services.config.caching.RedisCachingConfig.java

@Bean
JedisConnectionFactory jedisConnectionFactory() {
    JedisConnectionFactory factory = new JedisConnectionFactory();
    factory.setHostName(System.getProperty(Constants.REDIS_HOST_NAME, Constants.LOCALHOST));
    factory.setPort(Integer.parseInt(System.getProperty(Constants.REDIS_PORT)));
    factory.setUsePool(true);/*from w  ww  .  j  a  v  a 2  s  . c o  m*/
    return factory;
}

From source file:lab.home.mvn_tomcat_spring_redis_rest_api.config.SpringRedisConfig.java

@Bean
JedisConnectionFactory jedisConnectionFactory() {
    JedisConnectionFactory factory = new JedisConnectionFactory();
    factory.setHostName(redisHost);
    factory.setPort(redisPort);//from   ww w .j  a v  a2  s .  co  m
    factory.setUsePool(true);
    return factory;
}

From source file:com.jc.hitian.core.redis.RedisAutoConfiguration.java

@Bean
public JedisConnectionFactory jedisConnectionFactory(RedisProperties properties) {

    JedisConnectionFactory factory = new JedisConnectionFactory();
    factory.setHostName(properties.getHost());
    factory.setPort(properties.getPort());
    factory.setDatabase(properties.getDatabase());
    factory.setUsePool(properties.isUsePool());
    JedisPoolConfig config = new JedisPoolConfig();
    factory.setPoolConfig(config);/*  www.  j a  va 2  s .  c o  m*/
    return factory;
}

From source file:stormy.pythian.service.spring.ServiceConfiguration.java

@Bean
public RedisConnectionFactory redisConnectionFactory() {
    JedisConnectionFactory connectionFactory = new JedisConnectionFactory();
    connectionFactory.setHostName(redisHostName);
    connectionFactory.setPort(redisPort);
    connectionFactory.setPassword(redisPassword);
    return connectionFactory;
}

From source file:cn.org.once.cstack.config.CacheConfiguration.java

@Bean
public JedisConnectionFactory jedisConnectionFactory() {
    JedisConnectionFactory redisConnectionFactory = new JedisConnectionFactory();
    redisConnectionFactory.setHostName(redisIp);
    redisConnectionFactory.setPort(6379);
    return redisConnectionFactory;
}

From source file:internal.diff.common.configuration.RedisConfiguration.java

@Bean
public RedisConnectionFactory redisConnectionFactory() {

    JedisConnectionFactory connectionFactory = new JedisConnectionFactory();

    connectionFactory.setHostName(this.redisHost);

    return connectionFactory;
}

From source file:com.vcredit.lrh.db.redis.RedisCacheConfiguration.java

@Bean(name = "redisConnectionFactory")
public JedisConnectionFactory redisConnectionFactory() {
    JedisConnectionFactory redisConnectionFactory = new JedisConnectionFactory();
    redisConnectionFactory.setHostName(properties.getHost());
    redisConnectionFactory.setPort(properties.getPort());
    return redisConnectionFactory;
}

From source file:io.gravitee.repository.redis.common.RedisConnectionFactory.java

@Override
public org.springframework.data.redis.connection.RedisConnectionFactory getObject() throws Exception {
    JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory();
    jedisConnectionFactory.setHostName(readPropertyValue(propertyPrefix + "host", String.class, "localhost"));
    jedisConnectionFactory.setPort(readPropertyValue(propertyPrefix + "port", int.class, 6379));
    jedisConnectionFactory.setPassword(readPropertyValue(propertyPrefix + "password", String.class, null));
    jedisConnectionFactory.setTimeout(readPropertyValue(propertyPrefix + "timeout", int.class, -1));

    JedisPoolConfig poolConfig = new JedisPoolConfig();
    poolConfig.setMaxTotal(128);//  w  w  w  .j a  v a  2s  .c o m
    poolConfig.setBlockWhenExhausted(false);
    jedisConnectionFactory.setPoolConfig(poolConfig);

    jedisConnectionFactory.afterPropertiesSet();

    return jedisConnectionFactory;
}