I want to create an annotation which is only available to a specific type of return values. For example this is my annotation. I also have an interface: An example class that implements my interface: So after these, I want to configure my annotation in a way that it won’t even compile if the return type is not implementing MyInterface.
Tag: aop
Accessing spring bean proxy reference itself
I have an issue with @Cacheable and @CacheEviction annotations. When I call these methods in the bean where they are declared, the aop part is not getting executed. The underlying reason for this is that the bean access to its own instance itself, instead of accessing the spring proxy. I have read this question where it is said that in
AspectJ: How to weave an aspect library into a Java project
I build small library (Java and Maven) – using AspectJ. Library must be independent. Library deliver Aspects and Annotations. Function of library is – “call advice when executed a method with specific annotation”. All is ok when I use everything in one module, but problem appers when i separate library and project with classes which advice must be applied. I
How can I apply aop on a whole package except one subpackage
Assuming my current package structure in a spring projects as : com.stackoverflow |- service |- entities |- controllers |- package1 |- package2 |-util How can I apply an aspect to all the …
AspectJ pointcut expression match parameter annotations at any position
I’m trying to define a pointcut expression to match methods which contain a parameter annotated with a specific annotation, regardless of what position the parameter is in. In my case I’m looking for the @Constraint annotation. For example: Matching methods: So far I’ve tried the following expressions with no luck: Can someone point me to the right solution? is it
Spring AOP Advice Called Twice
For some reason, my Spring AOP advices are being called twice. I checked: Spring AOP advice is called twice but I am not using the Component annotation, and am declaring the aspect bean once and annotating it with @Aspect and that’s it. Somewhat belatedly I realized that one of my classes was not implementing an interface yet, which caused CGLIB2
NoAspectBoundException with aspectj and tapestry 5
I have a web project built with Tapestry 5.2.1. I have a simple logging aspect that I was using for tracing on this application. Everything was working fine until I started refactoring parts of the application and attempted to deploy it. When I deploy the application, no matter what page I attempt to go to I get the following exception:
Maven: compile aspectj project containing Java 1.6 source
Primary Question What I want to do is fairly easy. Or so you would think. However, nothing is working properly. Requirement: Using maven, compile Java 1.6 project using AspectJ compiler. Note: Our code cannot compile with javac. That is, it fails compilation if aspects are not woven in (because we have aspects that soften exceptions). Update 2/21/2011: There are two