Questions tagged [pointcut]
221 questions
0
votes
1 answer
2 advices colliding on the same fucntion
Hei,
I started learning Aspectj and I have built 2 aspects. Both aspects have a pointcut that match the same function, and both aspects have an around advice that will do something on that pointcut.
However only one advice will be "executed", and I…

Kropius Dop
- 105
- 1
- 9
0
votes
1 answer
A spring aop pointcut can filter for the combination of an annotation and a return type?
@Pointcut(Execution(@com.annotions.MyAnnotation void *(..))
Would this be a valid pointcut, if I want only methods to be advised with the @MyAnnotation and have the return type void?

Ringo777
- 97
- 7
0
votes
0 answers
AspectJ pointcut method signature in Java code
I have defined an Aspect with the following pointcut
pointcut transactedMethod() : TransactionBoundary.transactedMethod();
This is an alias created for all transactional methods with some error raised if proper exception is not raised.
public…

Vikash Jain
- 17
- 7
0
votes
1 answer
@Aspect - getSignature() is null
I created simple aspect to count how many times specific method is executed. I have to tell that I'm doing it first time so probably it's not really pretty.
First, I created something like that:
@Aspect
@Component
public class ItemAspect {
…

Weronika
- 15
- 6
0
votes
1 answer
@target pointcut throws IllegalStateException
In Spring boot AOP application I have a pointcut @target(MyAnnotation) || @annotation(MyAnnotation).
Advice should be executed if MyAnnotation is put either on executing object annotated with this annotation or on annotated method.
When I run…

Vitalii
- 10,091
- 18
- 83
- 151
0
votes
1 answer
Spring AOP pointcut for all public methods of an annotatted class (including parent class methods)
I have two classes
public class ParentTestClass {
public void publicMethodOfParent() {
}
}
@Component
@MyAnnotation
public class ChildTestClass extends ParentTestClass {
public void publicMethodOfChild() {
}
}
With Spring AOP I…

Vitalii
- 10,091
- 18
- 83
- 151
0
votes
1 answer
How to pass base package as a variable inside pointcut expression in Spring AOP?
I am creating a java library for logging purpose so that if any application uses my library then spring AOP's advices are applied to each method of the application. But in my library, I don't know the base package of the applications that will be…

raman bhadauria
- 145
- 2
- 11
0
votes
1 answer
AspectJ pointcuts and advice to capture the method call from one Java class to another
I have two classes Server and Client as follows:
import java.util.*;
public class Server {
private String name;
private ArrayList clients = new ArrayList();
public Server(String name) {
this.name = name;
…

Binary Terror
- 71
- 1
- 6
0
votes
1 answer
Policy enforcement to add a new item - ASPECTJ
I have to enforce a policy issuing a warning if items not belonging to a particular category are being added, apart from the three which are allowed and disallowing such additions.....
So far i am able to find the items and issue warning.... but not…

Baba
- 65
- 1
- 3
- 9
0
votes
1 answer
AspectJ pointcuts and advice
I have to enforce a policy issuing a warning if items not belonging to a particular category are being added, apart from the three which are allowed and disallowing such additions.....
So far i am able to find the items and issue warning.... but not…

John
- 4,413
- 6
- 25
- 28
0
votes
1 answer
Exception: java.lang.IllegalArgumentException: Pointcut is not well-formed Error?
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
@Aspect
@Component
public class MyDemoLogginAspect {
@Before("execution(* * add*())")
public void…
user12080466
0
votes
1 answer
Spring Aop Applying advice for a specific lines of code of a method
I need to know if we can apply advice(spring AOP) in middle of a method.I read some where that AOP is applicable only for bean method calls.But still i got this question. Please advise.
I got an idea by moving that piece of code to another method...

Kathiresan. N
- 48
- 1
- 12
0
votes
1 answer
Pointcut for Inherited methods with super method calls
I have the following classes
class A {
public void someone() {
helpMe();
}
private void helpMe() {
// do something here
}
}
class B extends A {
public void help() {
super.someone();
}
}
class C extends…

Nischit Pradhan
- 440
- 6
- 18
0
votes
1 answer
Avoid overlaping pointcuts and aspects in AOP
In package
com.repository I have :
Standalone interfaces extending spring data Repository
Interfaces extending spring data Repository with my own implementation in the same package
Repository classes implementing my repository interfaces
I would…

bastiat
- 1,799
- 2
- 19
- 38
0
votes
0 answers
How to use a external value in @Pointcut
I am writing a common component for team members.So I write an aspect with Spring-aop.Ideally,what others only need to do is defining an point-cut expression in .properties or others.But I find it is a bit difficult。
I have searched some information…

wutingjia
- 23
- 7