《spring3+memcache 注解配置》要点:
本文介绍了spring3+memcache 注解配置,希望对您有用。如果有疑问,可以联系我们。
相关主题:memcache扩展 / 键值KeyValue存储数据库
spring3+memcache
memcache在spring中的表明配置
准备的memcache包
java_memcached-release_2.6.6.jar
xmemcached-1.4.3.jar
在XML的设置装备摆设文件如下
<!-- memcache -->
<bean
id="memcachedClientBuilder"
class="net.rubyeye.xmemcached.XMemcachedClientBuilder"
p:connectionPoolSize="${memecache.server1.ConnectionPoolSize}"
p:failureMode="${memecache.server1.FailureMode}">
<!-- XMemcachedClientBuilder have two arguments.First is server list,and
second is weights array. -->
<constructor-arg>
<list>
<bean class="java.net.InetSocketAddress">
<constructor-arg>
<value>${memecache.server1.host}</value>
</constructor-arg>
<constructor-arg>
<value>${memecache.server1.port}</value>
</constructor-arg>
</bean>
</list>
</constructor-arg>
<constructor-arg>
<list>
<value>${memecache.server1.weight}</value>
</list>
</constructor-arg>
<property name="commandFactory">
<bean class="net.rubyeye.xmemcached.command.TextCommandFactory" />
</property>
<property name="sessionLocator">
<bean class="net.rubyeye.xmemcached.impl.KetamaMemcachedSessionLocator" />
</property>
<property name="transcoder">
<bean class="net.rubyeye.xmemcached.transcoders.SerializingTranscoder" />
</property>
</bean>
<!-- Use factory bean to build memcached client -->
<bean
id="memcachedClient"
factory-bean="memcachedClientBuilder"
factory-method="build"
destroy-method="shutdown" />
本故事纯属虚构,若有类同,请勿乱喷.
《spring3+memcache 注解配置》是否对您有启发,欢迎查看更多与《spring3+memcache 注解配置》相关教程,学精学透。维易PHP学院为您提供精彩教程。