• memcached usage


    https://github.com/ragnor/simple-spring-memcached/wiki/Getting-Started

    1) maven

    <dependency>
      <groupId>com.google.code.simple-spring-memcached</groupId>
      <artifactId>spymemcached-provider</artifactId>
      <version>4.0.0</version>
    </dependency>
    spymemcached

    2) applicationContext.xml

    <import resource="simplesm-context.xml" />
        <aop:aspectj-autoproxy />
        
        <bean name="defaultMemcachedClient" class="com.google.code.ssm.CacheFactory">
            <property name="cacheClientFactory">
              <bean name="cacheClientFactory" class="com.google.code.ssm.providers.spymemcached.MemcacheClientFactoryImpl" />
            </property>
            <property name="addressProvider">
              <bean class="com.google.code.ssm.config.DefaultAddressProvider">
                <property name="address" value="127.0.0.1:11211" />
              </bean>
            </property>
            <property name="configuration">
              <bean class="com.google.code.ssm.providers.CacheConfiguration">
                <property name="consistentHashing" value="true" />
              </bean>
            </property>
        </bean>
    spring config xml(part)

    3) service

    1     @Override
    2     @ReadThroughSingleCache(namespace = "carnum", expiration = 300)
    3     public List<TrainOrder> getCarList(String year, String month, @ParameterValueKeyProvider int trainNumber) {
    4         // TODO Auto-generated method stub
    5         return trainOrderDao.getCarnumberList(year, month, trainNumber);
    6     }
    TrainOrderServiceImpl.java(part)
  • 相关阅读:
    iis日志时间与本地日期不一样
    iis原理介绍
    IIS如何确定请求的处理程序
    handle 和module
    调试IIS服务器
    JS面向对象学习
    图片垂直居中大杂烩
    淘宝双十一页面(Flexible)
    用rem适配移动端
    About getByClass
  • 原文地址:https://www.cnblogs.com/xiaobin-hlj80/p/8977854.html
Copyright © 2020-2023  润新知