aopalliance

Inheriting annotation for AOP in GUICE

痴心易碎 提交于 2021-01-28 13:36:35
问题 I'm using Guice and AspectJ, and I am trying to do some AOP to measure the execution time of certain methods. I have this annotation which will be used to annotate all the methods I need to measure: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Inherited public @interface MyStopWatch { } I have this method interceptor: public class MyInterceptor implements org.aopalliance.intercept.MethodInterceptor { private final Logger logger = LoggerFactory.getLogger(MyInterceptor.class

Inheriting annotation for AOP in GUICE

扶醉桌前 提交于 2021-01-28 13:34:22
问题 I'm using Guice and AspectJ, and I am trying to do some AOP to measure the execution time of certain methods. I have this annotation which will be used to annotate all the methods I need to measure: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Inherited public @interface MyStopWatch { } I have this method interceptor: public class MyInterceptor implements org.aopalliance.intercept.MethodInterceptor { private final Logger logger = LoggerFactory.getLogger(MyInterceptor.class

How can I log private methods via Spring AOP?

╄→尐↘猪︶ㄣ 提交于 2019-12-06 10:34:41
问题 I am not able to log the private methods using spring aop performance logging. Below is the configuration I am using below configuration <aop:config proxy-target-class="true"> <aop:pointcut id="allServiceMethods" expression="execution(* com.mycom.app.abc..*.*(..))"/> <aop:advisor pointcut-ref="allServiceMethods" advice-ref="performanceMonitor" order="2"/> </aop:config> I am having cglib jar on my class path. 回答1: You have to use compile time weaving instead of the proxy usage for Spring AOP.

How can I log private methods via Spring AOP?

吃可爱长大的小学妹 提交于 2019-12-04 16:41:42
I am not able to log the private methods using spring aop performance logging. Below is the configuration I am using below configuration <aop:config proxy-target-class="true"> <aop:pointcut id="allServiceMethods" expression="execution(* com.mycom.app.abc..*.*(..))"/> <aop:advisor pointcut-ref="allServiceMethods" advice-ref="performanceMonitor" order="2"/> </aop:config> I am having cglib jar on my class path. You have to use compile time weaving instead of the proxy usage for Spring AOP. From Spring AOP - Supported Pointcut Designators Due to the proxy-based nature of Spring’s AOP framework,

Spring throws NoClassDefFoundError: MethodInterceptor although class exists within classpath

一曲冷凌霜 提交于 2019-12-04 04:39:03
问题 I'm developing a simple, training application with Spring MVC and Hibernate. I'm using Maven as build tool. All dependencies (spring, hibernate, aopalliance , junit etc.) are resolved using Maven's pom.xml file. $ mvn war:war glassfish:deploy works absolutley fine, the project is being deployed to the GlassFish server - all *.jar files are copied (including com.springsource.org.aopalliance-1.0.0.jar ). I've made a simple servlet to test whether aopalliance exisists within classpath: protected