Open sunyongfengchina opened 1 year ago
Hello @sunyongfengchina ,
Could you explain why do you want to do it? Caching consumes memory, so it's not "free" like some people think.
There also is another possibly related request #1993 if you are interested.
`public class InterceptorChain {
private final List interceptors = new ArrayList<>();
//When the same proxy object is called multiple times, the object returned each time is the same result. Can I cache proxy objects and final objects with key value pairs? public Object pluginAll(Object target) { for (Interceptor interceptor : interceptors) { target = interceptor.plugin(target); } return target; }
public void addInterceptor(Interceptor interceptor) { interceptors.add(interceptor); }
public List getInterceptors() {
return Collections.unmodifiableList(interceptors);
}
} `