Questions tagged [pointcut]
221 questions
2
votes
1 answer
AspectJ pointcut expression for all classes that contains a especific word in their names
What's up? folks!
I'm trying to intercept all classes that contains a specific word in their names... something as below:
@Before("execution(* com.domain.model.*.*Repository.save(..))")
I have the following methods to…

Gustavo Amaro
- 131
- 1
- 4
- 7
2
votes
1 answer
Exception while using PointCut in spring
Aspect Class:
import org.aspectj.lang.annotation.AdviceName;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
@Aspect
public class LoggingAspect…

irfan khan
- 23
- 2
2
votes
2 answers
Aspect on super interface method implemented in abstract super class
I have a problem quite similar to: How to create an aspect on an Interface Method that extends from A "Super" Interface, but my save method is in an abstract super class.
The structure is as follows -
Interfaces:
public interface…

adben002
- 23
- 1
- 4
2
votes
2 answers
AspectJ with weblogic
I am trying to run AspectJ on Weblogic with LTW. My pointcut is for public constructor and methods, and advices are for Before, AfterReturning and AfterThrowing. I am getting following error when I access a simple "Hello World"…

user3613747
- 105
- 2
- 8
2
votes
1 answer
Does a set() field pointcut get invoked if field is set via reflection?
I have a field set pointcut, which seems to do as I expect. Its defined as follows
before(Object newval): set(@Serviced private * *.*) && args(newval)
The above is meant to capture: whenever a private field attribute, annotated with @Serviced, is…

johnm
- 7,327
- 1
- 24
- 35
2
votes
1 answer
Why is my pointcut not advising methods declared in a another aspect?
I'm using Roo and Compile Time Weaving for my application. One of the classes that Roo has generated is my UserIntegrationTest:
@RooIntegrationTest(entity =…

Eric B.
- 23,425
- 50
- 169
- 316
2
votes
2 answers
How to write the proper pointcut to match an interface returning object?
I don't know if this is possible, but I am trying to write a pointcut which would match any method that returns an object implementing a specific interface.
Given the following:
public class User implements Auditable{
private int id;
private…

Eric B.
- 23,425
- 50
- 169
- 316
2
votes
1 answer
Read Aspectj Pointcut definition from property file for LTW
I using aspectj LTW in my guice application and I m trying to make the pointcut definition for the aspects controlled from a configuration file. for example:
pointcut publicOperation() : execution(*** READ THIS FROM CONFIG/PROPERTY FILE…

Sammy
- 4,538
- 8
- 33
- 52
2
votes
2 answers
AspectJ pointcut for constructor using java.lang.reflection
The following example is a reduction of the real problem in that it tries to simplify is as much as possible.
I have a java interface, and several objects that implement that interface, like:
public interface Shape{
public void draw();
…

Flame_Phoenix
- 16,489
- 37
- 131
- 266
2
votes
1 answer
Which methods are being covered by a pointcut?
Is it possible to know which methods are covered with a pointcut in AspectJ?
The background for this question is that I have a pointcut which covers every method (except for its own):
pointcut traceMethods() : (execution(* *(..))&&…

c_uld
- 81
- 1
- 9
2
votes
1 answer
Aspectj matching pointcut whilst not caring about method-level annotation parameters
I have stumped myself with a problem involving Aspectj. What I am looking to do is have an "after() throwing" match against a call annotated with a method-level annotation.
@MyAnnotation
public void doSomething(Param p1, Param p2)
If I…

James 'Cookie' Cook
- 556
- 2
- 12
2
votes
2 answers
AspectJ expression '@within' doesn't effect on concrete class which doesn't have public members
Here are my sample classes:
public abstract class AbstractAgent {
public void count(List movies) {
sum(movies);
}
protected abstract void sum(List movies);
}
@Broker
public class DefaultAgent extends…

user1693294
- 23
- 2
2
votes
0 answers
Spring AOP advice - conditional in debug mode
I want to use the AOP advice/pointcuts, etc in debug mode only (as a master global config: e.g. when log4j is in DEBUG threshold).
How can I do this in the application.xml config or elsewhere?
I am using AOP annotations…

adi
- 1,711
- 3
- 29
- 50
2
votes
1 answer
Abstract types in pointcuts
I'd like to intercept method calls with a certain signature with an Aspect.
My pointcut should look something like this:
execution(public Result * (Input))"
But Result and Input are abstract.
Would this pointcut also match all Methods, that return a…
user321068
1
vote
2 answers
Make a check on AOP pointcut expression
I need to make a check in my pointcut expression like.
I have this bean:

Vítor Nóbrega
- 1,219
- 4
- 26
- 53