<!-- 打开Spring的Annotation支持 -->
<context:annotation-config />
<!-- 设定Spring 去哪些包中找Annotation,不需要像传统的方式配置多个bean -->
<context:component-scan base-package="com.weixin.qq" />
<!-- 激活aop代理 -->
<aop:aspectj-autoproxy proxy-target-class="true" />
<!--指定一个缺省的executor给@Async使用。 -->
<task:annotation-driven executor="excutor" />
<!--id:当配置多个executor时,被@Async("id")指定使用;也被作为线程名的前缀。 -->
<task:executor id="excutor" pool-size="5" /
@Async//如果不指定名字,会使用缺省的“asyncExecutor”
public void sendMsg(TOrder order){
//异步方法
}
引用块内容http://blog.youkuaiyun.com/clementad/article/details/47403185