zoukankan      html  css  js  c++  java
  • danga memcacheClient与spring结合

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
        xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
                http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
                ">
    
        <bean id="memcachedPool" class="com.danga.MemCached.SockIOPool"
            factory-method="getInstance" init-method="initialize" destroy-method="shutDown">
            <constructor-arg>
                <value>neeaMemcachedPool</value>
            </constructor-arg>
            <property name="servers">
                <list>
                    <value>${memcache.server}</value>
                </list>
            </property>
            <property name="initConn">
                <value>${memcache.initConn}</value>
            </property>
            <property name="minConn">
                <value>${memcache.minConn}</value>
            </property>
            <property name="maxConn">
                <value>${memcache.maxConn}</value>
            </property>
            <property name="maintSleep">
                <value>${memcache.maintSleep}</value>
            </property>
            <property name="nagle">
                <value>${memcache.nagle}</value>
            </property>
            <property name="socketTO">
                <value>${memcache.socketTO}</value>
            </property>
        </bean>
        <bean id="memcachedClient" class="com.danga.MemCached.MemCachedClient"
            depends-on="memcachedPool">
            <constructor-arg>
                <value>neeaMemcachedPool</value>
            </constructor-arg>
        </bean>
        <bean id="memcache" class="com.jtxw.cache.impl.MemcacheService">
            <property name="client" ref="memcachedClient"></property>
        </bean>
    </beans>
    memcache.server=127.0.0.1\:11211
    memcache.initConn=20
    memcache.minConn=10
    memcache.maxConn=50
    memcache.maintSleep=3000
    memcache.nagle=false
    memcache.socketTO=3000
  • 相关阅读:
    mssql锁
    gridview 分页兼容BOOTSTRAP
    BOOTSTRAP前端模板
    bootstrap 简单模板
    ajax 跨域访问的解决方案
    webapi之权限验证
    webapi权限常见错误
    ajax跨域解决方案
    iis 部署webapi常见错误及解决方案
    OOM AutoMapper的简单实用
  • 原文地址:https://www.cnblogs.com/atyou/p/2840460.html
Copyright © 2011-2022 走看看