利用拦截器监控service的调用情况
来源:互联网 发布:阿提拉全面战争优化差 编辑:程序博客网 时间:2024/06/08 05:17
拦截器
package com.example.interceptor;import org.aopalliance.intercept.MethodInterceptor;import org.aopalliance.intercept.MethodInvocation;/** * @Author: sun * @Email: szw3366@126.com * @Date: 2017/12/5 * @Time: 13:17 * @Description: ${DESCRIPTION} */public class MyMethodInterceptor implements MethodInterceptor{ @Override public Object invoke(MethodInvocation methodInvocation) throws Throwable { System.out.println("调用方法前调用"); Object o = methodInvocation.proceed(); System.out.println("调用方法后调用"); return o; }}
注册器
package com.example.interceptor;import org.aopalliance.aop.Advice;import org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;/** * @Author: sun * @Email: szw3366@126.com * @Date: 2017/12/5 * @Time: 13:20 * @Description: ${DESCRIPTION} */@Configurationpublic class AppConfig { /** * 加载前注册 * @return */ @Bean public Advice myMethodInterceptor(){ return new MyMethodInterceptor(); } @Bean public BeanNameAutoProxyCreator beanNameAutoProxyCreator() { BeanNameAutoProxyCreator beanNameAutoProxyCreator = new BeanNameAutoProxyCreator(); beanNameAutoProxyCreator.setBeanNames("*userInfoService*"); beanNameAutoProxyCreator.setInterceptorNames("myMethodInterceptor"); return beanNameAutoProxyCreator; }}
阅读全文
0 0
- 利用拦截器监控service的调用情况
- 利用ngxtop实时监控Nginx的访问情况
- 利用ngxtop实时监控nginx的访问情况
- Service如何利用RegisterDeviceNotification监控Volume的装载和卸载
- Service如何利用RegisterDeviceNotification监控Volume的装载和卸载
- Service如何利用RegisterDeviceNotification监控Volume的装载和卸载 .
- Service如何利用RegisterDeviceNotification监控Volume的装载和卸载
- spring Mvc的controller调用service时同步的情况
- struts2 拦截器的调用
- 拦截电话---> 关于利用反射 调用系统 hiden的 方法
- web service 拦截器
- JavaAdapter扩展进行Service调用拦截处理
- Spring AOP进行日志记录,管理 (使用Spring的拦截器功能获取对action中每个方法的调用情况,在方法调用前)
- Spring AOP进行日志记录,管理 (使用Spring的拦截器功能获取对action中每个方法的调用情况,在方法调用前
- Spring AOP进行日志记录,管理 (使用Spring的拦截器功能获取对action中每个方法的调用情况,在方法调用前
- Spring AOP进行日志记录,管理 (使用Spring的拦截器功能获取对action中每个方法的调用情况,在方法调用前
- android 编写拦截拦截短信的service
- 利用SoapHeader验证web service调用的合法性(dwonmoon)
- MySql主从配置文件问题详解(数据不同步解决方案)
- java、List、ArrayList、LinkedList
- mysql 数据管理
- 蓝桥杯 算法训练 排序
- shell脚本如何获取当前时间
- 利用拦截器监控service的调用情况
- Eclipse中Dynamic Web Module的版本Version及Content Directory修改
- 根据时间点 划分某一条记录归属
- 从大到小产生随机10个1000以内随机整数
- log4j的使用以及mybatis在控制台打印sql语句
- Linux下用户组、文件权限详解
- Qt中修改excel文件内容并另存的示例
- 开发前的准备工作
- 安卓按键:偶尔输入框写入内容失败的一些额外处理