zoukankan      html  css  js  c++  java
  • 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)
  • 相关阅读:
    【Gamma】Scrum Meeting 5
    【Gamma】Scrum Meeting 4
    【Gamma】Scrum Meeting 3
    团队贡献分汇总
    【Gamma】Scrum Meeting 2
    【Gamma】 Scrum Meeting 1
    Beta阶段测试报告
    From scipy.misc import imread 中 ImportError: cannot import name imread的解决方法
    【软件工程】结对项目
    【软件工程】第一次阅读作业
  • 原文地址:https://www.cnblogs.com/xiaobin-hlj80/p/8977854.html
Copyright © 2011-2022 走看看