Questions tagged [pointcut]
221 questions
1
vote
2 answers
can we have mutiple pointcuts mapped to a single advice
In aspectj , can we have multiple pointcuts mapped to the single advice ?
for example below are two separate pointcuts
@Pointcut("execution(* xyz.get(..))")
void pointcut1() {
}
@Pointcut("execution(* abc.put(..))")
void pointcut2() {
…

Bravo
- 8,589
- 14
- 48
- 85
1
vote
1 answer
Aspectj - how to call advised method from within same advice, without triggering an infinite loop
i want to log all method call i make in my code except the ones within the logger, using AspectJ.
@Aspect
public class Logger
{
// Point Cuts
//-----------
@Pointcut("execution(* org.myDomain.*..*.*(..))")
public void selectAll(){}
…

Tal
- 31
- 9
1
vote
1 answer
Hibernate pagination with AOP pointcuts
Is there any known approach to hibernate pagination with aspect-oriented annotations (or anything else that does the job) with pointcuts to identify a Criteria in any given method and apply to it the setFirstResults and setMaxResults API…

nuno
- 1,771
- 1
- 19
- 48
1
vote
1 answer
Anyway to create a pointcut to methods of a class' members?
Given a class with a bunch of members, each with their own getter/setter/etc methods, is there a way to design a pointcut that will trigger only on members' methods when contained within the parent class?
For example:
public MyClass{
List myList…

Eric B.
- 23,425
- 50
- 169
- 316
1
vote
4 answers
Aspect around advice not triggering on controller
I have an aspect advice that tracks the execution of classes annotated with @Service. The code is currently working but I would like to change it to track REST endpoints on controllers instead of autowired services. Here is the code:
@Aspect
public…

Dan Little
- 91
- 1
- 10
1
vote
1 answer
Spring AOP after advice not working properly on getter function
In Spring Framework, I am facing a strange issue while working with AOP.
I have the following simple bean class for a greeting:
public class HelloBean {
private String message;
public String getMessage() {
return message;
}
…

code4life
- 11
- 1
1
vote
1 answer
Aspectj: Pointcut no longer works when declared in aop.xml ( LTW)
I m trying to define my aspect as a concrete-aspect to be able to define pointcuts in aop.xml without compiling the code. I m using LTW.
when I define my poincut exp in the aspect class itself and define the aspect as a simple aspect ( ), it works…

Sammy
- 4,538
- 8
- 33
- 52
1
vote
1 answer
A simple pointcut expression in Spring
I'm using Spring security 3.2.0 with the same version of the Spring framework. Spring security works well in my project. In order to protect methods in my DAO classes (and others), I want to use the following pointcut approach (in the…

Tiny
- 27,221
- 105
- 339
- 599
1
vote
3 answers
How to modify the attributes of a returned object using AspectJ?
I have a class that looks like follows (from Spring Roo DataOnDemand) which returns a new transient (not persisted) object for use in unit testing. This is what the code looks like after we do a push-in from Spring Roo's ITD.
public class…

tgharold
- 721
- 6
- 15
1
vote
0 answers
how to pass context(ApplicationContext) as an argument to logBefore Method(Method of Aspect)?
I want to implement an aspect to avoid lazy Loading problems .
so how to pass context(Application Context) as an argument for logBefore Method?
What is the signature pointcut defines the method above(the place to which I make "???"), knowing that…

الحكمة ظالة المؤمن
- 21
- 4
0
votes
3 answers
How to run aspect advice for a method which is called by another method in the same class
I am having a throuble about Spring AOP. I am trying to trigger a method using aspect but the method that will trigger the aspect is also the method of the same class and aspect is not working(No errors by the way).Like this
class A extends…

Neron
- 1,500
- 7
- 30
- 52
0
votes
2 answers
using annotations in spring pointcut
I am using annotation to indicate that an advice needs to be applied to the method.
I have the two methods in an interface called IMaintenanceDAOSupport
@AuditLogging
void insert(M domainobject, IntResponse response, String…

user2434
- 6,339
- 18
- 63
- 87
0
votes
1 answer
Why when make add spring-cloud-starter-sleuth got Pointcut must not be null exception
When I add implementation(group = "org.springframework.cloud", name = "spring-cloud-starter-sleuth") then after starting Spring Application I got exception:
2023-05-25 09:07:12.914 ERROR [,,] 22516 --- [ main] o.s.boot.SpringApplication …

DenisKorotchenko
- 41
- 2
0
votes
1 answer
Call adviced method from around advice and avoiding infinite loop without using cflow
I want to capture all method executions in com.ABC.MyClass using AspectJ
package com.ABC
public class MyClass{
public methodA(){
}
public methodB(){
methodA();
}
}
Below is the Aspect…

komal Thawani
- 129
- 1
- 9
0
votes
1 answer
Pointcut not working for method which throws Exception
I am trying to add Pointcut on execution of a method to total time taken by method to execute. But my pointcut is not getting called. Similar method which does not throws any exception , pointcut for that method is being called.I am not able to…

Loren
- 320
- 1
- 10
- 25