com.jquicker.cache.CacheAdvice Maven / Gradle / Ivy
package com.jquicker.cache;
import java.lang.reflect.Method;
import com.jquicker.aop.Advice;
/**
* @author OL
*/
public class CacheAdvice implements Advice {
private Object target; // 将要创建动态代理的对象(RedisUtils)
private CacheAspect aspect; // 切面
public CacheAdvice(Object target, CacheAspect aspect) {
super();
this.target = target;
this.aspect = aspect;
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
aspect.addPrefix(args);
Object result = method.invoke(target, args);
return result;
}
@Override
public Object getTarget() {
return target;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy