-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I make a cache for InterceptorChain.pluginAll #2832
Comments
Hello @sunyongfengchina , Could you explain why do you want to do it? There also is another possibly related request #1993 if you are interested. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
`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);
}
}
`
The text was updated successfully, but these errors were encountered: