{"id":853,"date":"2023-05-28T02:10:40","date_gmt":"2023-05-27T18:10:40","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=853"},"modified":"2023-05-28T02:10:40","modified_gmt":"2023-05-27T18:10:40","slug":"spring-%e2%91%a9-aop-%e5%88%9b%e5%bb%ba%e4%bb%a3%e7%90%86%e5%af%b9%e8%b1%a1%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/spring-%e2%91%a9-aop-%e5%88%9b%e5%bb%ba%e4%bb%a3%e7%90%86%e5%af%b9%e8%b1%a1%e8%af%a6%e8%a7%a3\/","title":{"rendered":"Spring \u2469 AOP \u521b\u5efa\u4ee3\u7406\u5bf9\u8c61\u8be6\u89e3"},"content":{"rendered":"<div class='wxsyncmain'>\n<section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" style=\"font-size: 16px;color: black;padding: 0px 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;overflow-wrap: break-word;text-align: left;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &quot;PingFang SC&quot;, Cambria, Cochin, Georgia, Times, &quot;Times New Roman&quot;, serif;\">\n<section><mp-common-profile class=\"js_uneditable custom_select_card mp_profile_iframe\" data-pluginname=\"mpprofile\" data-weui-theme=\"light\" data-id=\"MzU5MTg2OTc3Ng==\" data-headimg=\"http:\/\/mmbiz.qpic.cn\/mmbiz_png\/fY4QmJ5a6icHwnQcJNnBTVFbO7UAHRzibLgEmunvgVcWlmluVpicdNkGAiaNROH9RqVgInCazzkMUJQ5OEhdcGvwwA\/0?wx_fmt=png\" data-nickname=\"DevXJava\" data-alias=\"DevXJava\" data-signature=\"Java\u6280\u672f\u5206\u4eab\" data-from=\"0\" data-is_biz_ban=\"0\"><\/mp-common-profile><\/section>\n<figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"0.5291005291005291\"  data-type=\"jpeg\" data-w=\"567\" style=\"display: block;margin: 0 auto;max-width: 100%;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020427867.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.5291005291005291\"  data-type=\"jpeg\" data-w=\"567\" style=\"display: block;margin: 0 auto;max-width: 100%;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020427867.jpeg\"><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: #888;font-size: 14px;\"><br  \/><\/figcaption><\/figure>\n<h1 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 24px;\"><span style=\"display: none;\"><\/span><span>Spring \u2469 AOP \u521b\u5efa\u4ee3\u7406\u5bf9\u8c61\u8be6\u89e3<\/span><span><\/span><\/h1>\n<blockquote data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-top: none;border-right: none;border-bottom: none;display: block;font-size: 0.9em;overflow: auto;border-left: 3px solid rgba(0, 0, 0, 0.4);background: rgba(0, 0, 0, 0.05);color: rgb(106, 115, 125);padding: 10px 10px 10px 20px;margin-bottom: 20px;margin-top: 20px;\">\n<p style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0px;color: black;line-height: 26px;\">Spring \u6e90\u7801\u7cfb\u5217\u6587\u7ae0\u4f1a\u9075\u5faa\u7531\u6d45\u5165\u6df1,\u7531\u6613\u5230\u96be,\u7531\u5b8f\u89c2\u5230\u5fae\u89c2\u7684\u539f\u5219,\u76ee\u6807\u662f\u5c3d\u91cf\u964d\u4f4e\u5b66\u4e60\u96be\u5ea6,\u800c\u4e0d\u662f\u4e00\u4e0a\u6765\u5c31\u8ff7\u5931\u5728\u6e90\u7801\u5f53\u4e2d. \u6587\u7ae0\u4f1a\u4ece\u4e00\u4e2a\u573a\u666f\u4f5c\u4e3a\u51fa\u53d1\u70b9\uff0c\u9488\u5bf9\u6027\u7684\u76ee\u7684\u6027\u6781\u5f3a\u7684\u9488\u5bf9\u8be5\u573a\u666f\u5bf9 Spring \u7684\u5b9e\u73b0\u539f\u7406\uff0c\u6e90\u7801\u8fdb\u884c\u63a2\u7a76\u5b66\u4e60\u3002\u8be5\u7cfb\u5217\u6587\u7ae0\u4f1a\u8ba9\u4f60\u6536\u83b7\u4ec0\u4e48? \u4ece\u5bf9 Spring \u7684\u4f7f\u7528\u8005\u6210\u4e3a Spring \u4e13\u5bb6\u3002\u8be5\u6587\u7ae0\u4f1a\u540c\u6b65\u5728\u5fae\u4fe1\u516c\u4f17\u53f7 \u3010DevXJava\u3011, \u65b9\u4fbf\u5728\u5fae\u4fe1\u5ba2\u6237\u7aef\u9605\u8bfb\u3002<\/p>\n<\/blockquote>\n<blockquote data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-top: none;border-right: none;border-bottom: none;display: block;font-size: 0.9em;overflow: auto;border-left: 3px solid rgba(0, 0, 0, 0.4);background: rgba(0, 0, 0, 0.05);color: rgb(106, 115, 125);padding: 10px 10px 10px 20px;margin-bottom: 20px;margin-top: 20px;\">\n<p style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0px;color: black;line-height: 26px;\">\u672c\u7ae0\u4f1a\u63a2\u7a76 <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;color: #1e6bb8;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">spring<\/code> <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;color: #1e6bb8;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">AOP<\/code> \u4ee3\u7406\u5bf9\u8c61\u521b\u5efa\u7684\u8be6\u7ec6\u8fc7\u7a0b\u548c\u539f\u7406. \u8be6\u7ec6\u63a2\u7a76 <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;color: #1e6bb8;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">AnnotationAwareAspectJAutoProxyCreator<\/code> \u7684\u5de5\u4f5c\u539f\u7406\u3002<\/p>\n<\/blockquote>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 22px;\"><span style=\"display: none;\"><\/span><span>\u573a\u666f<\/span><span><\/span><\/h2>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background: url(&quot;https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020443528.jpeg&quot;) 10px 10px \/ 40px no-repeat rgb(40, 44, 52);height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;\"><\/span><code style=\"overflow-x: auto;padding: 16px;color: #abb2bf;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #282c34;border-radius: 5px;\">@Override<br  \/>public AopProxy createAopProxy(AdvisedSupport config) throws AopConfigException {<br  \/>   if (!NativeDetector.inNativeImage() &amp;&amp;<br  \/>         (config.isOptimize() || config.isProxyTargetClass() || hasNoUserSuppliedProxyInterfaces(config))) {<br  \/>      Class&lt;?&gt; targetClass = config.getTargetClass();<br  \/>      if (targetClass == null) {<br  \/>         throw new AopConfigException(\"TargetSource cannot determine target class: \" +<br  \/>               \"Either an interface or a target is required for proxy creation.\");<br  \/>      }<br  \/>      if (targetClass.isInterface() || Proxy.isProxyClass(targetClass) || AopProxyUtils.isLambda(targetClass)) {<br  \/>         return new JdkDynamicAopProxy(config);<br  \/>      }<br  \/>      return new ObjenesisCglibAopProxy(config);<br  \/>   }<br  \/>   else {<br  \/>      return new JdkDynamicAopProxy(config);<br  \/>   }<br  \/>}<br  \/><\/code><\/pre>\n<figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"0.665929203539823\"  data-type=\"png\" data-w=\"904\" style=\"display: block;margin: 0 auto;max-width: 100%;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020439245.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.665929203539823\"  data-type=\"png\" data-w=\"904\" style=\"display: block;margin: 0 auto;max-width: 100%;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020439245.png\"><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: #888;font-size: 14px;\"><\/figcaption><\/figure>\n<blockquote data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-top: none;border-right: none;border-bottom: none;display: block;font-size: 0.9em;overflow: auto;border-left: 3px solid rgba(0, 0, 0, 0.4);background: rgba(0, 0, 0, 0.05);color: rgb(106, 115, 125);padding: 10px 10px 10px 20px;margin-bottom: 20px;margin-top: 20px;\">\n<p style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0px;color: black;line-height: 26px;\">\u540e\u7eed\u7684\u6587\u7ae0\u4e2d\u4f1a\u8be6\u7ec6\u63a2\u7a76 <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;color: #1e6bb8;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">JdkDynamicAopProxy<\/code> \u548c <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;color: #1e6bb8;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">ObjenesisCglibAopProxy<\/code> \u7684\u5f02\u540c\u3002<\/p>\n<\/blockquote>\n<hr data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"height: 1px;margin: 10px 0px;border-right: none;border-bottom: none;border-left: none;border-top: 1px solid black;\"  \/>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\"><code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;color: #1e6bb8;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">DevX<\/code> \u4f1a\u6301\u7eed\u5206\u4eab <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;color: #1e6bb8;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">Java<\/code> \u6280\u672f\u5e72\u8d27\uff0c\u5982\u679c\u4f60\u89c9\u5f97\u672c\u6587\u5bf9\u4f60\u6709\u5e2e\u52a9\u5e0c\u671b\u4f60\u53ef\u4ee5\u5206\u4eab\u7ed9\u66f4\u591a\u7684\u670b\u53cb\u770b\u5230\u3002\u8be5\u6587\u7ae0\u4f1a\u540c\u6b65\u5728\u5fae\u4fe1\u516c\u4f17\u53f7 \u3010DevXJava\u3011, \u65b9\u4fbf\u5728\u5fae\u4fe1\u5ba2\u6237\u7aef\u9605\u8bfb\u3002<\/p>\n<p style=\"text-align: center;\"><strong style=\"font-weight: bold;color: black;\">DevX \u4e0d\u6b62\u4e8e\u6280\u672f<\/strong><\/p>\n<p><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"258\" style=\"display: block;margin: 0px auto;max-width: 100%;width: 194px;height: 194px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020442948.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"258\" style=\"display: block;margin: 0px auto;max-width: 100%;width: 194px;height: 194px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020442948.jpeg\"><\/noscript><\/p>\n<\/section>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 DevXJava              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>Spring \u2469 AOP \u521b\u5efa\u4ee3\u7406\u5bf9\u8c61\u8be6\u89e3 Spring \u6e90\u7801\u7cfb\u5217\u6587\u7ae0\u4f1a\u9075\u5faa\u7531\u6d45\u5165\u6df1,\u7531\u6613\u5230\u96be,\u7531\u5b8f\u89c2\u5230\u5fae\u89c2\u7684\u539f\u5219,\u76ee\u6807\u662f\u5c3d\u91cf\u964d\u4f4e &#8230;<\/p>\n","protected":false},"author":2,"featured_media":845,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-853","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020426954-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020427867.jpeg","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020426954-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020426954.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020427867.jpeg","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020426954-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020426954.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020426954.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020427867.jpeg","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020427867.jpeg","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020439245.png","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020439245.png","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020442948.jpeg","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528020442948.jpeg","id":"image5"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Spring Boot","post_date":"2023-05-27","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":272,"next_post_id":535,"next_post_title":"Controller\u5c42\u4ee3\u7801\u5c31\u8be5\u8fd9\u4e48\u5199\uff0c\u7b80\u6d01\u53c8\u4f18\u96c5\uff01","previous_post_id":583,"previous_post_title":"Springboot \u52a8\u6001\u914d\u7f6e\u53ca\u4e00\u952e\u6253\u5305\u90e8\u7f72","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=853"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/853\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/845"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}