• 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
  • 相关阅读:
    git hub 资料汇总
    java 实例化是调用了子类重写方法
    java接口示例
    cumber + selenium +java自动化测试
    解决selenium 启动ie浏览器报错:Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones
    springmvc 数据回显功能
    springmvc管理资源开放
    springmvc 中controller与jsp传值
    springmvc注解事例
    springmvc
  • 原文地址:https://www.cnblogs.com/atyou/p/2840460.html
Copyright © 2020-2023  润新知