From 572ef6e2c4266d49f12ede949b2a421f9fe5db0a Mon Sep 17 00:00:00 2001 From: Mic Date: Fri, 8 Feb 2013 14:26:00 +0800 Subject: [PATCH] moved pointcut to @Repository instead of @Service In that way we don't need a dedicated config file for the Service layer --- .springBeans | 2 -- .../petclinic/aspects/CallMonitoringAspect.java | 2 +- src/main/resources/spring/service-config.xml | 13 ------------- src/main/webapp/WEB-INF/mvc-core-config.xml | 2 +- src/main/webapp/WEB-INF/web.xml | 2 +- 5 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 src/main/resources/spring/service-config.xml diff --git a/.springBeans b/.springBeans index a22a616d6..2f9dc4c20 100644 --- a/.springBeans +++ b/.springBeans @@ -11,7 +11,6 @@ src/main/webapp/WEB-INF/mvc-view-config.xml src/main/resources/spring/dao-config.xml src/main/resources/spring/datasource-config.xml - src/main/resources/spring/service-config.xml @@ -24,7 +23,6 @@ src/main/resources/spring/dao-config.xml src/main/resources/spring/datasource-config.xml src/main/resources/spring/jmx-aop-config.xml - src/main/resources/spring/service-config.xml diff --git a/src/main/java/org/springframework/samples/petclinic/aspects/CallMonitoringAspect.java b/src/main/java/org/springframework/samples/petclinic/aspects/CallMonitoringAspect.java index 234a25be0..9e2b68eda 100644 --- a/src/main/java/org/springframework/samples/petclinic/aspects/CallMonitoringAspect.java +++ b/src/main/java/org/springframework/samples/petclinic/aspects/CallMonitoringAspect.java @@ -55,7 +55,7 @@ public class CallMonitoringAspect { } - @Around("within(@org.springframework.stereotype.Service *)") + @Around("within(@org.springframework.stereotype.Repository *)") public Object invoke(ProceedingJoinPoint joinPoint) throws Throwable { if (this.isEnabled) { StopWatch sw = new StopWatch(joinPoint.toShortString()); diff --git a/src/main/resources/spring/service-config.xml b/src/main/resources/spring/service-config.xml deleted file mode 100644 index 99ef66db7..000000000 --- a/src/main/resources/spring/service-config.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/mvc-core-config.xml b/src/main/webapp/WEB-INF/mvc-core-config.xml index 3b1a242bb..6ce11a4a6 100644 --- a/src/main/webapp/WEB-INF/mvc-core-config.xml +++ b/src/main/webapp/WEB-INF/mvc-core-config.xml @@ -15,7 +15,7 @@ - + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 0dfdc6bf0..aa7171e44 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -23,7 +23,7 @@ id="WebApp_ID" version="2.5"> --> contextConfigLocation - classpath:spring/dao-config.xml, classpath:spring/service-config.xml, classpath:spring/jmx-aop-config.xml + classpath:spring/dao-config.xml, classpath:spring/jmx-aop-config.xml