
aop
kong-kong
记录流水账
展开
-
ProxyConfig、ProxyFactoryBean关键属性
org.springframework.aop.framework.ProxyConfig proxyTargetClass:trueif the target class is to be proxied, rather than the target class’s interfaces. If this property value is set totrue, then CGLIB proxies are created (but see alsoJDK- and CGLIB-base...翻译 2020-10-15 00:10:59 · 534 阅读 · 0 评论 -
MethodMatcher
MethodMatcherTrueMethodMatcher没有args参数的matches方法,永远返回truefinal class TrueMethodMatcher implements MethodMatcher, Serializable { @Override public boolean isRuntime() { return false; } @Override public boolean matches(Method method,.原创 2020-10-15 00:11:43 · 761 阅读 · 0 评论 -
ReflectiveMethodInvocation目标对象拦截
类图ReflectiveMethodInvocation属性protected final Object proxy;@Nullableprotected final Object target;protected final Method method;protected Object[] arguments = new Object[0];@Nullableprivate final Class<?> targetClass;/** * Lazily in原创 2020-10-13 18:26:29 · 2947 阅读 · 0 评论 -
ProxyConfig属性之exposeProxy
exposeProxy((Pojo) AopContext.currentProxy()).bar();如果调用了AopContext.currentProxy,需要把exposeProxy设置true,否则会报下面错误:Exception in thread "main" java.lang.IllegalStateException: Cannot find current proxy: Set 'exposeProxy' property on Advised to 'true' to原创 2020-10-12 19:08:59 · 688 阅读 · 0 评论 -
org.springframework.aop.framework相关源码类
本文主要来自org.springframework.aop.framework当前包的相关类ProxyConfigprivate boolean proxyTargetClass = false;private boolean optimize = false;boolean opaque = false;boolean exposeProxy = false;private boolean frozen = false;public void copyFrom(ProxyConfi原创 2020-10-12 18:56:20 · 674 阅读 · 0 评论 -
spring-aop适配类
本文主要来自org.springframework.aop.framework.adapter包中的类AdvisorAdapterpublic interface AdvisorAdapter { boolean supportsAdvice(Advice advice); MethodInterceptor getInterceptor(Advisor advisor);}MethodBeforeAdviceAdapterMethodBeforeAdvice的适配类cl原创 2020-10-12 18:35:12 · 360 阅读 · 0 评论 -
spring-aop基础类
SpringProxypublic interface SpringProxy {}IntroductionInfopublic interface IntroductionInfo { Class<?>[] getInterfaces();}MethodMatcherIntroductionAwareMethodMatcherTrueMethodMatcherfinal class TrueMethodMatcher implements.原创 2020-10-12 18:28:14 · 297 阅读 · 0 评论 -
aopalliance之Invocation
本文相关类出自org.aopalliance包中Joinpointpublic interface Joinpoint { /** * Proceed to the next interceptor in the chain. * <p>The implementation and the semantics of this method depends * on the actual joinpoint type (see the children interfac.原创 2020-10-12 19:07:16 · 297 阅读 · 0 评论 -
AOP之Interceptor
Advicepublic interface Advice {}Interceptorpublic interface Interceptor extends Advice {}MethodInterceptor/** * Intercepts calls on an interface on its way to the target. These *...原创 2018-12-03 19:44:17 · 454 阅读 · 0 评论