Questions tagged [pointcut]

221 questions
1
vote
1 answer

AOP pointcut for @After

I want AOP logging for the method's return value @After("execution(* com.dbs.tup.sample.service.*.*(..))") public void logAfter(JoinPoint point) { log.info("{} is returning {}", point.getSignature().getName(), "???"); }
maya16
  • 593
  • 1
  • 6
  • 19
1
vote
0 answers

Spring AOP PointCut only working when Bean defined in ApplicationContext

I am wondering, why my point cuts ins Spring AOP do only work, if I specify my beans containing the join points explicitly in the application context XML. Normally in my project, all Spring beans are defined over annotations:…
theFriedC
  • 424
  • 7
  • 20
1
vote
1 answer

aspectj cross-thread pointcut

I am new with AspectJ annotation for Java, and I am wondering if it is possible to put pointcut on a cross thread invocation. Here is the code: public class App { public static void main( String[] args ) { new…
Irwan Hendra
  • 150
  • 10
1
vote
3 answers

Overwrite method argument in AspectJ

I have an aspect intercepting the logging method. That logging method is a simple method taking one object as an argument: logMessage(Object message) How can I modify that object in my aspect and log a new one? Following does not work: void…
CorrieSparrow
  • 521
  • 1
  • 6
  • 23
1
vote
1 answer

How to write a pointcut for all methods of class annotated by @Service and having return type void

I am trying to write a point cut for all void methods of classes that are annotated by @Service. At first I tried to create two separate point cuts and then join them on advice calls but even that didnt work as I think I do not know the right…
Nick Div
  • 5,338
  • 12
  • 65
  • 127
1
vote
1 answer

Expression for Parametrized annotation AspectJ

Trying to created a point cut which take parameter from annotation and then can use it further.So far I have reached: pointcut callDemoAspectPointCut(): call(Papa+.new()) && @within(MyAnnotation); //With param here after() returning(Object…
xyz
  • 2,160
  • 3
  • 20
  • 31
1
vote
2 answers

Spring AOP : Interface method with Parameter annotation captured, but annotation is not present

I'm using Spring AOP to intercept a method execution. I have an interface that looks like the following: public interface MyAwesomeService { public Response doThings(int id, @AwesomeAnnotation SomeClass instance); } Here is the implementation…
n00bc0der
  • 103
  • 1
  • 3
  • 9
1
vote
1 answer

Spring AOP pointcut expression syntax for wildcard

I'm currently using AspectJ 1.6.9 and i wonder why the following pointcut expression: (execution (* it.dtt..endpoint.*..*.invoke*(..))) doesn't match the execution of the method declared: protected Object invokeInternal(Object object) throws…
1
vote
1 answer

Spring AOP is being invoked unexpectedly

I have configured Spring AOP for 2 different packages in our application to log exceptions. There are 2 different configurations for each package:
Rahul
  • 637
  • 5
  • 16
1
vote
1 answer

Can I use my own object in args when using Aspectj?

I'm new with AspectJ and I tried to do this: public class MyDBDAO { public boolean update(MyObject myObject) {} } And Aspect: @Aspect @Component public class AspectJClass { @Pointcut("execution(* com.myclass.MyDBDAO.update()) &&…
ellen
  • 13
  • 4
1
vote
1 answer

AspectJ join points to advice only "boundary" executions and calls

1) Is it possible to intercept executions (or perhaps calls) towards (from outside to inside) a set of classes (or perhaps a package, but not sub-packages) and outward calls (from those classes to outside that group of classes), but not "internal"…
Marco
  • 111
  • 2
  • 8
1
vote
1 answer

Difference between *+ and * when matching a class in AspectJ?

Given these pointcuts taken from the following resource: http://maverick-amey.blogspot.ru/2007/12/using-cflow-and-cflowbelow-in-pointcuts.html pointcut methodCalls() : call(public void Foo.*(..)) ; pointcut…
tonix
  • 6,671
  • 13
  • 75
  • 136
1
vote
1 answer

How to make my JLabels red with use of aspectJ?

my Project has a MessageUtil class, which has methods to show messages, I'm trying to make the texts of my Jlabels red using aspectJ, without use of aspectJ it is enough to add 'for loop' to one of the methods wich makes multiLabel text…
user3777963
1
vote
1 answer

AspectJ creates plenty of methods on pointcut

I am new to AOP (using AspectJ / ajc) and have searched / googled the internet high and low searching for an answer to my puzzle. Hopefully, someone here might have it. As I was given to understand by the documentation, AspectJ is suppose to inject…
Ori Lentz
  • 3,668
  • 6
  • 22
  • 28
1
vote
0 answers

Spring performance interceptor not logging with log4j2

I have used spring aop t to log time of service execution but it's not logging. i am not getting any exception as well. help me to solve this issue whether it's problem in log4j2 configuration or it's wrong with point cut expression. Following is my…
Paresh Dudhat
  • 1,166
  • 1
  • 14
  • 28