首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

【小家Spring】面向切面编程之---Spring AOP的原理讲解以及源码分析(Cannot find current proxy: Set exposeProxy property on )

$Proxy32 是JDK的动态代理了 return "service hello"; } 此处做一步输出,我们发现this代表还是本对象。...获得这个代理对象的一个副本(ThreadLocal里面),从而我们可以很方便得在Spring框架上下文中拿到当前代理对象(处理事务时很方便) // 必须为true才能调用AopContext得方法,否则报错:Cannot...find current proxy: Set 'exposeProxy' property on Advised to 'true' to make it available....boolean exposeProxy() default false; } 当然,最重点的,还是这一句@Import(AspectJAutoProxyRegistrar.class),下面看看它 AspectJAutoProxyRegistrar...)) { BeanDefinition apcDefinition = registry.getBeanDefinition(AUTO_PROXY_CREATOR_BEAN_NAME);

2.1K30
您找到你想要的搜索结果了吗?
是的
没有找到
领券