{"id":1555,"date":"2016-09-07T07:43:57","date_gmt":"2016-09-07T07:43:57","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=1555"},"modified":"2016-09-07T08:59:59","modified_gmt":"2016-09-07T08:59:59","slug":"custom-pointcut-expression-xml","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/custom-pointcut-expression-xml\/","title":{"rendered":"Custom Pointcut Expression XML"},"content":{"rendered":"<p><strong>spring.xml<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;beans xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;\r\n\txmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; \r\n\txmlns:aop=&quot;http:\/\/www.springframework.org\/schema\/aop&quot;\r\n\txsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans\r\n\thttp:\/\/www.springframework.org\/schema\/beans\/spring-beans-3.0.xsd \r\n\thttp:\/\/www.springframework.org\/schema\/aop \r\n\thttp:\/\/www.springframework.org\/schema\/aop\/spring-aop-3.0.xsd &quot;&gt;\r\n\r\n\t&lt;aop:aspectj-autoproxy \/&gt;\r\n        &lt;bean id=&quot;customerBo&quot; class=&quot;CustomerBoImpl&quot; \/&gt;\r\n\t&lt;bean name=&quot;objTriangle&quot; class=&quot;com.mugil.shapes.Triangle&quot;&gt;\r\n         \t&lt;property name=&quot;name&quot; value=&quot;Triangle Name&quot;&gt;&lt;\/property&gt;\r\n        &lt;\/bean&gt;\r\n        &lt;bean name=&quot;objCircle&quot; class=&quot;com.mugil.shapes.Circle&quot;&gt;\r\n    \t        &lt;property name=&quot;name&quot; value=&quot;Circle Name&quot;&gt;&lt;\/property&gt;\r\n        &lt;\/bean&gt;\r\n        &lt;bean id=&quot;shapeService&quot; class=&quot;com.mugil.shapes.ShapeService&quot; autowire=&quot;byName&quot;\/&gt;    \t\r\n        &lt;bean name=&quot;loggingAspect&quot; class=&quot;com.mugil.shapes.LoggingAspect&quot;\/&gt;\r\n          &lt;aop:config&gt;\r\n    \t     &lt;aop:aspect id=&quot;loggingAspect&quot; ref=&quot;loggingAspect&quot;&gt;\r\n    \t\t&lt;aop:pointcut expression=&quot;execution(* com.mugil.shapes.*.get*())&quot; id=&quot;allGetters&quot;\/&gt;\r\n    \t\t&lt;aop:around method=&quot;LoggingAdvice2&quot; pointcut-ref=&quot;allGetters&quot;\/&gt;\r\n    \t     &lt;\/aop:aspect&gt;\r\n          &lt;\/aop:config&gt;\r\n&lt;\/beans&gt;\r\n<\/pre>\n<p><strong>spring.xml<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;aop:aspect id=&quot;loggingAspect&quot; ref=&quot;loggingAspect&quot;&gt;\r\n<\/pre>\n<p>equivalent to<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Aspect\r\npublic class LoggingAspect {\r\n<\/pre>\n<p><strong>spring.xml<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;aop:pointcut expression=&quot;execution(* com.mugil.shapes.*.get*())&quot; id=&quot;allGetters&quot;\/&gt;\r\n<\/pre>\n<p>equivalent to<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Pointcut(&quot;execution(* com.mugil.shapes.*.get*())&quot;)\r\npublic void allGetters()\r\n{\t \r\n}\r\n<\/pre>\n<p><strong>spring.xml<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;aop:around method=&quot;LoggingAdvice2&quot; pointcut-ref=&quot;allGetters&quot;\/&gt;\r\n<\/pre>\n<p>equivalent to<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Around(&quot;allGetters()&quot;)\r\npublic void LoggingAdvice2(ProceedingJoinPoint pjp)\r\n{\r\n.\r\n.\r\n\r\n<\/pre>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;aop:pointcut expression=&quot;execution(* com.mugil.shapes.*.get*())&quot; id=&quot;allGetters&quot;\/&gt;\r\n&lt;aop:around method=&quot;LoggingAdvice2&quot; pointcut-ref=&quot;allGetters&quot;\/&gt;\r\n<\/pre>\n<p><em>could be replaced using pointCut<\/em><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;aop:around method=&quot;LoggingAdvice2&quot; pointcut=&quot;execution(* com.mugil.shapes.*.get*())&quot;\/&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>spring.xml &lt;beans xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xmlns:aop=&quot;http:\/\/www.springframework.org\/schema\/aop&quot; xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans-3.0.xsd http:\/\/www.springframework.org\/schema\/aop http:\/\/www.springframework.org\/schema\/aop\/spring-aop-3.0.xsd &quot;&gt; &lt;aop:aspectj-autoproxy \/&gt; &lt;bean id=&quot;customerBo&quot; class=&quot;CustomerBoImpl&quot; \/&gt; &lt;bean name=&quot;objTriangle&quot; class=&quot;com.mugil.shapes.Triangle&quot;&gt; &lt;property name=&quot;name&quot; value=&quot;Triangle Name&quot;&gt;&lt;\/property&gt; &lt;\/bean&gt; &lt;bean name=&quot;objCircle&quot; class=&quot;com.mugil.shapes.Circle&quot;&gt; &lt;property name=&quot;name&quot; value=&quot;Circle Name&quot;&gt;&lt;\/property&gt; &lt;\/bean&gt; &lt;bean id=&quot;shapeService&quot; class=&quot;com.mugil.shapes.ShapeService&quot; autowire=&quot;byName&quot;\/&gt; &lt;bean name=&quot;loggingAspect&quot; class=&quot;com.mugil.shapes.LoggingAspect&quot;\/&gt; &lt;aop:config&gt; &lt;aop:aspect id=&quot;loggingAspect&quot; ref=&quot;loggingAspect&quot;&gt; &lt;aop:pointcut expression=&quot;execution(* com.mugil.shapes.*.get*())&quot; id=&quot;allGetters&quot;\/&gt; &lt;aop:around method=&quot;LoggingAdvice2&quot; pointcut-ref=&quot;allGetters&quot;\/&gt; &lt;\/aop:aspect&gt; &lt;\/aop:config&gt; &lt;\/beans&gt; spring.xml &lt;aop:aspect&hellip; <a href=\"https:\/\/codethataint.com\/blog\/custom-pointcut-expression-xml\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[191],"tags":[],"class_list":["post-1555","post","type-post","status-publish","format-standard","hentry","category-aop"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=1555"}],"version-history":[{"count":3,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1555\/revisions"}],"predecessor-version":[{"id":1558,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1555\/revisions\/1558"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=1555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=1555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=1555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}