资源简介
chartroom-master.zip
代码片段和文件信息
package com.chartroom.config;
import com.chartroom.util.PropertiesReader;
import com.chartroom.util.RedisInit;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
/**
* Created by icinfo on 2017-09-21.
*/
@Configuration
@Import({WebSocketConfig.class})
@ComponentScan(basePackages = “com.chartroom“)
public class SpringConfig {
//属性配置文件
@Bean
public PropertyPlaceholderConfigurer propertyPlaceholderConfigurer(){
PropertyPlaceholderConfigurer propertyPlaceholderConfigurer
= new PropertyPlaceholderConfigurer();
Resource jdbcResource = new ClassPathResource(“jdbc.properties“);
Resource springResource = new ClassPathResource(“spring.properties“);
propertyPlaceholderConfigurer.setLocations(jdbcResourcespringResource);
return propertyPlaceholderConfigurer;
}
//redis配置
@Bean
public RedisConnectionFactory redisConnectionFactory(){
JedisConnectionFactory jedisConnectionFactory =
new JedisConnectionFactory();
jedisConnectionFactory.setHostName(PropertiesReader.redisHost);
jedisConnectionFactory.setPort(PropertiesReader.redisPort);
jedisConnectionFactory.setPassword(PropertiesReader.redisPwd);
jedisConnectionFactory.setTimeout(PropertiesReader.redisTimeout);
return jedisConnectionFactory;
}
@Bean
public StringRedisTemplate stringRedisTemplate(){
StringRedisTemplate stringRedisTemplate =
new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(redisConnectionFactory());
return stringRedisTemplate;
}
@Bean
public RedisInit redisInit(){
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
JedisPool jedisPool = new JedisPool(jedisPoolConfigPropertiesReader.redisHostPropertiesReader.redisPort
PropertiesReader.redisTimeoutPropertiesReader.redisPwd);
Jedis jedis = jedisPool.getResource();
jedis.set(“onlineCount““0“);
jedis.close();
return new RedisInit();
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-09-27 08:45 chartroom-master\
目录 0 2017-09-27 08:45 chartroom-master\.idea\
目录 0 2017-09-27 08:45 chartroom-master\.idea\artifacts\
文件 301 2017-09-27 08:45 chartroom-master\.idea\artifacts\chartroom_war.xm
文件 5237 2017-09-27 08:45 chartroom-master\.idea\artifacts\chartroom_war_exploded.xm
文件 630 2017-09-27 08:45 chartroom-master\.idea\compiler.xm
文件 141 2017-09-27 08:45 chartroom-master\.idea\encodings.xm
文件 232 2017-09-27 08:45 chartroom-master\.idea\kotlinc.xm
目录 0 2017-09-27 08:45 chartroom-master\.idea\libraries\
文件 502 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__com_alibaba_fastjson_1_2_38.xm
文件 510 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__com_fasterxm
文件 632 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__com_fasterxm
文件 583 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__com_fasterxm
文件 611 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__com_fasterxm
文件 677 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__com_fasterxm
文件 724 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__com_fasterxm
文件 574 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__com_fasterxm
文件 513 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__com_sun_mail_javax_mail_1_5_0.xm
文件 524 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__commons_codec_commons_codec_1_9.xm
文件 527 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__commons_dbcp_commons_dbcp_1_2_2.xm
文件 593 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__commons_fileupload_commons_fileupload_1_3_1.xm
文件 491 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__commons_io_commons_io_2_4.xm
文件 546 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__commons_logging_commons_logging_1_2.xm
文件 513 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__commons_pool_commons_pool_1_3.xm
文件 515 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__javax_activation_activation_1_1.xm
文件 471 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__javax_javaee_api_7_0.xm
文件 599 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__javax_validation_validation_api_1_1_0_Final.xm
文件 574 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__javax_websocket_javax_websocket_api_1_0.xm
文件 425 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__jstl_jstl_1_2.xm
文件 450 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__junit_junit_3_8_1.xm
文件 562 2017-09-27 08:45 chartroom-master\.idea\libraries\Maven__mysql_mysql_connector_java_5_1_30.xm
............此处省略96个文件信息
相关资源
- 百度网盘地址.txt224454
- p0lfc7.docx
- 史上最全学习云计算视频资料.zip
- Louis_IC卡.zip
- ConsuleUI.zip
- NetStream.zip
- Sim_EKB_Install_2018_05_20.rar
- sgu6qx.rar
- Tcl教程.pdf
- FileComp.rar
- Unity4.3Sourcecode
- elong75416_10583833.zip
- Solidworks2015_SP5.0.torrent
- ATmega2560_Library.SchLib
- SVPWM.zip
- 1306176648Sockets进行文件传输.zip
- PDFFactoryProversion4.05.Keygen.zip
- 文件校验工具MD5SHA1SHA210.2TOKYOHOT含源码
- CPrimer第5版_带书签_高清完整版.pdf.r
- 扫雷.rar
- CallTifftoy.rar
- mwkiim.doc
- 地址链接.txt
- Thief.rar
- TurboCodeDemo.rar
- MusicEncode.rar
- fft7.v
- cuda_8.0.61_win10.exe.txt
- diramisumy_2329847.rar
- uxibzj.rar
评论
共有 条评论