{"id":303580,"date":"2021-01-16T20:31:49","date_gmt":"2021-01-16T12:31:49","guid":{"rendered":"http:\/\/4563.org\/?p=303580"},"modified":"2021-01-16T20:31:49","modified_gmt":"2021-01-16T12:31:49","slug":"spring-cache%e3%80%81async-aop-%e5%ae%9e%e7%8e%b0%e7%96%91%e9%97%ae","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=303580","title":{"rendered":"Spring Cache\u3001Async AOP \u5b9e\u73b0\u7591\u95ee"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Spring Cache\u3001Async AOP \u5b9e\u73b0\u7591\u95ee               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wangsilence <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4e3a\u4ec0\u4e48 Spring Cache \u3001Async AOP \u5b9e\u73b0\u90fd\u81ea\u5df1\u5b9e\u73b0\u4e86 Advisor \u3001Advice \u3001Pointcut\uff0c \u4e3a\u4ec0\u4e48\u4e0d\u76f4\u63a5\u7528 @Aspect \u8868\u8fbe\u5f0f\uff0c\u76f4\u63a5\u62e6\u622a\u6ce8\u89e3\uff0c\u5269\u4e86\u5f88\u591a\u4ee3\u7801\uff0cAdvisor \u3001Pointcut \u90fd\u4e0d\u7528\u5199\u3002 \u66f4\u7b80\u5355\u7684\u65b9\u5f0f\u4e0d\u7528\uff0c\u4e3a\u4ec0\u4e48\u8981\u8fd9\u4e48\u590d\u6742\u5b9e\u73b0\uff1f<\/p>\n<pre><code>@Aspect @Component public class Aspect {      @Pointcut(\"@annotation(com.xxx.Cache)\")     public void pointcut() {     }      @Around(value = \"pointcut() &amp;&amp; @annotation(cache)\")     public Object imMonitorAround(ProceedingJoinPoint pjp, Cache cache) throws Throwable {         String methodKey = imMonitor.value();         return pjp.proceed();     } } <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>1<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4968487\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ychost <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Aspect \u8868\u8fbe\u5f0f\u5fc5\u987b\u5f3a\u5236\u8981\u6c42\u542f\u52a8\u7684\u65f6\u5019\u6307\u5b9a Aspect \u7684 Processor \u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Spring Cache\u3001Asyn&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/303580"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=303580"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/303580\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=303580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=303580"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=303580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}