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
@Override
@ReadThroughSingleCache(namespace = "carnum", expiration = 300)
public List<TrainOrder> getCarList(String year, String month, @ParameterValueKeyProvider int trainNumber) {
// TODO Auto-generated method stub
return trainOrderDao.getCarnumberList(year, month, trainNumber);
}
TrainOrderServiceImpl.java(part)
memcached usage的更多相关文章
- linux上安装memcached步骤
libevent: http://libevent.org/ 服务器端:https://code.google.com/archive/p/memcached/downloads 客户端: http: ...
- linux系统下安装memcached
检查libevent 首先检查系统中是否安装了libevent rpm -qa|grep libevent 如果安装了则查看libevent的安装路径,后续安装时需要用到 rpm -ql libeve ...
- php没有开启Memcache扩展类时
模拟PHP Memcache 类.当服务器没有开启Memcache扩展的时候.可以采用本类使用方法class_exists('Memcache') or include './Memcache.cla ...
- 缓存、队列(Memcached、redis、RabbitMQ)
本章内容: Memcached 简介.安装.使用 Python 操作 Memcached 天生支持集群 redis 简介.安装.使用.实例 Python 操作 Redis String.Hash.Li ...
- 搭建LNAMP环境(七)- PHP7源码安装Memcached和Memcache拓展
上一篇:搭建LNAMP环境(六)- PHP7源码安装MongoDB和MongoDB拓展 一.安装Memcached 1.yum安装libevent事件触发管理器 yum -y install libe ...
- 缓存、队列(Memcached,Redis,rabbitMQ)
一.Memcached Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载.它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态.数据库驱动网站的 ...
- 使用 python 实现 memcached 的启动服务脚本 rc
#!/usr/bin/python #coding:utf-8 import sys import os from subprocess import Popen, PIPE class Memcac ...
- Linux设置Memcached开机启动
Memcached开机启动方式 方法一: 在 /etc/rc.d/rc.local 文件中追加启动命令 /usr/local/memcached/bin/memcached -u root -d - ...
- Linux上设置memcached自启动
#!/bin/sh # # memcached: MemCached Daemon # # chkconfig: - 90 25 # description: MemCached Daemon # # ...
随机推荐
- 小强的HTML5移动开发之路(4)——CSS2和CSS3
来自:http://blog.csdn.net/dawanganban/article/details/17653149 在上一篇中我们提到学习HTML5要具备CSS的知识,在页面设计的时候HTML5 ...
- rambbit mq 安装
https://blog.csdn.net/lmjy102/article/details/78571078 http://www.rabbitmq.com/tutorials/tutorial-on ...
- vim的颜色修改,高亮设置。
在vim.org 搜一下,下载一个color scheme, 放到~/.vim/colors/下(linux)或者$HOME/.vim/colors/下(windows) 再在你的.vimrc文件中加 ...
- Vim/Vi实用技巧(第二版)
Vim/Vi实用技巧 1.导入文件 :r [文件名] #导入到当前编辑的文件中 如 :r /etc/inittab 文件上部为/etc/services文件,下部为/etc/inittab文件 2.执 ...
- ITU-R BT.1788建议书 对多媒体应用中视频质量的主观评估方法
ITU-R BT.1788建议书 对多媒体应用中视频质量的主观评估方法 (ITU‑R 102/6号研究课题) (2007年) 范围 数字广播系统允许提供多媒体和数据广播应用,包括视频.音频.静态图像. ...
- DB Query Analyzer 6.03, the most excellent Universal DB Access tools on any Microsoft Windows OS
DB Query Analyzer 6.03, the most excellent Universal database Access tools on any Microsoft Wind ...
- LeetCode之“动态规划”:Dungeon Game
题目链接 题目要求: The demons had captured the princess (P) and imprisoned her in the bottom-right corner of ...
- Myeclipse Db Browser使用
1.打开Myeclipse,选择菜单栏Window-->Show View-->Other,展开MyEclipse Database,选择DB Browser,打开数据库浏览视图 2. 空 ...
- Linxu命令与文件的搜索 - which, whereis, locate, find
which (寻找『运行档』) [root@www ~]# which [-a] command 选项或参数: -a :将所有由 PATH 目录中可以找到的命令均列出,而不止第一个被找到的命令名称 范 ...
- myBatis源码之Executor、BaseExecutor和CachingExecutor
接下来是mybatis的执行过程,mybatis提供了一个接口Executor,Executor接口主要提供了update.query方法及事物相关的方法接口 /** * @author Clinto ...