All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jquicker.cache.CacheAdvice Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
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