Questions tagged [pointcut]

221 questions
1
vote
0 answers

how to pointcut to my custom throwable class which extends Exception class? (@aspect)

I have custom SubscriberNotFoundException class which extends Exception class. I want to pointcut its some methods using aspects for catching exceptions and logging to file. Here is my code: try { -------- } …
1
vote
2 answers

Spring AOP for controller inside package

I am looking for a pointcut expression that might satisfy my needs, I have already figured one out but seems to be having some performance issues, and I believe there should be an easier solution. I have a lot of packages…
COCOLICHE
  • 35
  • 4
1
vote
2 answers

Creating A pointcut using args designator with no types results in BeanCurrentlyInCreationException

Using Spring AOP, when attempting to create a Pointcut using the designator args while not providing any types results in a series of exceptions starting with BeanCurrentlyInCreationException The Example object _001_Spring_AOP_Pointcut_Args_NoArgs…
user5132301
1
vote
1 answer

Why does Spring-AOP pointcut work for save(..) but not saveAll(..)

I have a Spring-Data repository like this: package com.example.demo; @RepositoryRestResource public interface FooRepository extends JpaRepository { @Override S save(S entity); @Override
Zack
  • 3,819
  • 3
  • 27
  • 48
1
vote
1 answer

How does this execution pointcut expression work?

I came across an answer from @kriegaex , which I am unable to comprehend. The pointcut expression I am trying to understand is the following @Around("execution(* (@MyAnnotation *).*(..)) || execution(@MyAnnotation * *(..))") As I understand , this…
R.G
  • 6,436
  • 3
  • 19
  • 28
1
vote
1 answer

How to create pointcut to feign client that supports interface inheritance?

In a Spring Boot project I have a simple feign client @MyAnnotation @FeignClient(name="some-name", url="http://test.url") public interface MyClient { @RequestMapping(method = RequestMethod.GET, value = "/endpoint") List
Vitalii
  • 10,091
  • 18
  • 83
  • 151
1
vote
1 answer

Pointcut matching an annotation's parameter value

Suppose I have an annotation as following: @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface DBOperation { boolean isReadOperation() default true; } Then in the Aspect, how could I want to write two pointcuts,…
vincent zhang
  • 444
  • 5
  • 20
1
vote
2 answers

Pointcut or Aspect Around All Service Methods with Annotation @Transactional(readOnly = false)

Is it possible to use Spring AOP or AspectJ to intercept all Service methods (contained in classes in the com.app.service.* package) having the annotation @Transactional(readOnly = false) (other elements possible as well in Spring's @Transactional…
gene b.
  • 10,512
  • 21
  • 115
  • 227
1
vote
2 answers

AspectJ - pointcut advice based on annotated function

I have 2 custom annotations: @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface FlowPoint { public enum PointInFlow { START, END } PointInFlow…
Shico Ren
  • 17
  • 6
1
vote
1 answer

I need a Spring AOP pointcut explanation

I have seen two variations of pointcut patterns: This execution(* some.package.*.*(..)) and this execution(* some.package.* *(..)) What is the meaning of the dot (or of it absence) between the last two *'s?
Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
1
vote
1 answer

AspectJ: Intercept return result of method inside another method

I need help to write some Aspectj advice on this particular case: Suppose we have this class: package org.group; public class Person { public void method1(String id, String number) { //some code List list =…
Tanorix
  • 230
  • 2
  • 16
1
vote
1 answer

pointcut expression to parse @ModelAttribute as method parameter

I have a @ModelAttribute(key) defined in the @controllerAdvice and i am uisng the same model attribute in multiple controller methods as method parameter because the (key) will be available throughout all the controllers. I am adding the attribute…
1
vote
1 answer

error at ::0 can't find referenced pointcut

the exception trace is: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut peformance at…
Dr.C
  • 13
  • 1
  • 4
1
vote
1 answer

Spring AOP pointcut on instance creation of a class

I have a class annotated with @Tool. I'd love to run some kind of initializing aspect over it as soon as it is created. I have not found any documentation on how to wire to this particular event. I thought about annotating the class constructor but…
xetra11
  • 7,671
  • 14
  • 84
  • 159
1
vote
0 answers

In Spring AOP AfterReturning Advice Annotation, how to get back a return value from the advice next to the point cut method

I have a small need, am using AfterReturning annotation. Here is an example code: //File: applicationContext.xml