forked from iBase4J/iBase4J
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request iBase4J#26 from iBase4J/develop
web数据缓存使用JSON格式
- Loading branch information
Showing
11 changed files
with
68 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:p="http://www.springframework.org/schema/p" xmlns:c="http://www.springframework.org/schema/c" | ||
xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans | ||
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd | ||
http://www.springframework.org/schema/context | ||
http://www.springframework.org/schema/context/spring-context-4.0.xsd"> | ||
<!-- jedis 配置--> | ||
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig" > | ||
<!--最小空闲数--> | ||
<property name="minIdle" value="${redis.minIdle}" /> | ||
<!--最大空闲数--> | ||
<property name="maxIdle" value="${redis.maxIdle}" /> | ||
<!--最大连接数--> | ||
<property name="maxTotal" value="${redis.maxTotal}" /> | ||
<!--最大建立连接等待时间--> | ||
<property name="maxWaitMillis" value="${redis.maxWaitMillis}" /> | ||
<!--是否在从池中取出连接前进行检验,如果检验失败,则从池中去除连接并尝试取出另一个--> | ||
<property name="testOnBorrow" value="${redis.testOnBorrow}" /> | ||
</bean > | ||
<!-- redisCluster配置 --> | ||
<!-- <bean id="redisClusterConfiguration" class="org.springframework.data.redis.connection.RedisClusterConfiguration"> | ||
<constructor-arg name="propertySource"> | ||
<bean id="resourcePropertySource" class="org.springframework.core.io.support.ResourcePropertySource" | ||
c:name="redis.properties" c:resource="classpath:config/system.properties"/> | ||
</bean> | ||
</constructor-arg> | ||
</bean> --> | ||
<!-- redis服务器中心 --> | ||
<bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" | ||
p:host-name="${redis.host}" p:port="${redis.port}" p:password="${redis.password}" | ||
p:pool-config-ref="jedisPoolConfig" p:timeout="${redis.timeout}" /> | ||
<!-- c:cluster-config-ref="redisClusterConfiguration" --> | ||
<!-- 缓存序列化方式 --> | ||
<bean id="keySerializer" class="org.springframework.data.redis.serializer.StringRedisSerializer" /> | ||
<bean id="valueSerializer" class="org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer" /> | ||
<!-- 缓存 --> | ||
<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate"> | ||
<property name="connectionFactory" ref="jedisConnectionFactory" /> | ||
<property name="keySerializer" ref="keySerializer" /> | ||
<property name="valueSerializer" ref="valueSerializer" /> | ||
<property name="hashKeySerializer" ref="keySerializer" /> | ||
<property name="hashValueSerializer" ref="valueSerializer" /> | ||
</bean> | ||
<bean class="org.ibase4j.core.support.cache.RedisHelper" > | ||
<property name="redisTemplate" ref="redisTemplate" /> | ||
</bean> | ||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters