1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| package com.cloud.retrieve.utils;
|
| import redis.clients.jedis.Jedis;
|
| /**
| * redis缓存运用
| *
| * @author TongJun
| *
| */
| public class RedisPool {
|
| // redis 对象
| private static Jedis jedis = null;
| private static final String IP = "192.168.1.173";
| private static final int PROT = 6379;
|
| /**
| * 单例模式构造redis对象
| *
| * @return
| */
| public static synchronized Jedis getClient() {
| if (jedis == null) {
| jedis = new Jedis(IP, PROT);
| }
| return jedis;
| }
|
| }
|
|